xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.05k stars 787 forks source link

设置环境变量XMAKE_LOG, 在after_build中调用自定义命令, 命令的输出应该也导入到日志文件 #4970

Closed wendal closed 6 months ago

wendal commented 6 months ago

Is your feature request related to a problem? Please describe.

  1. 设置环境变量XMAKE_LOG=build.log
  2. 执行常规xmake编译
  3. 执行完毕后, build.log存在, 但自定义命令(os.exec)的输出内容, 没有出现在build.log里

Describe the solution you'd like

支持自定义命令的输出内容也写入到日志文件

Describe alternatives you've considered

No response

Additional context

No response

Issues-translate-bot commented 6 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: Set the environment variable XMAKE_LOG, call the custom command in after_build, the output of the command should also be imported into the log file

waruqi commented 6 months ago

支持不了,只能存 lua 层 log ,获取了 os.execv输出,只能走内部重定向,但是重定向了,终端就不回显了,而且也不建议这么搞,这个 log 通常也不是给用户用的,是这边开发和vscode插件等内部特殊用途使用的。。对于用户不会考虑做各种对这个 log file的支持

Issues-translate-bot commented 6 months ago

Bot detected the issue body's language is not English, translate it automatically.


It cannot be supported. You can only save the Lua layer log. After obtaining the os.execv output, you can only use internal redirection. However, if you redirect, the terminal will not echo, and it is not recommended to do this. This log is usually not for users. It is used for internal special purposes such as development here and vscode plug-in. . Users will not consider providing various support for this log file.

wendal commented 6 months ago

ok