Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

让 console 输出带上 tracing 信息 #5248

Open
fengmk2 opened this issue Aug 11, 2023 · 7 comments
Open

让 console 输出带上 tracing 信息 #5248

fengmk2 opened this issue Aug 11, 2023 · 7 comments
Assignees

Comments

@fengmk2
Copy link
Member

fengmk2 commented Aug 11, 2023

请详细告知你的新点子(Nice Ideas):

新增一个配置,让 console 在启动的时候做一下 global 替换,开发者可以无脑使用 console.log 打印日志,然后日志输出到 stdout 和 stderr 的时候有关联的 tracing 信息。

@fengmk2 fengmk2 self-assigned this Aug 11, 2023
@popomore
Copy link
Member

感觉这样替换不好吧?console.log 还是保持输出到 stdout 里面去。

@fengmk2
Copy link
Member Author

fengmk2 commented Aug 12, 2023

想了一下确实保持到 stdout 合适,不过还是想加上 tracing 日志,到 stdout 里面也能看到关联信息。

@fengmk2 fengmk2 changed the title 让 console 等价于 app.logger 让 console 输出带上 tracing 信息 Aug 12, 2023
@popomore
Copy link
Member

希望打 trace 就用 logger?

@fengmk2
Copy link
Member Author

fengmk2 commented Aug 14, 2023

希望打 trace 就用 logger?

会使用到一些开源三方库,不太可能每个库都去 fork 改造一遍吧。

@fengmk2 fengmk2 closed this as completed Nov 25, 2023
@killagu
Copy link
Contributor

killagu commented Jan 10, 2024

可以搞个增强能力,console 可以复制到一个独立日志文件,然后想怎么改都可以了。不论是加前缀还是结构化都不影响。

@fengmk2 fengmk2 reopened this Jan 10, 2024
@fengmk2
Copy link
Member Author

fengmk2 commented Jan 10, 2024

可以搞个增强能力,console 可以复制到一个独立日志文件,然后想怎么改都可以了。不论是加前缀还是结构化都不影响。

global 覆盖默认的 console?

@killagu
Copy link
Contributor

killagu commented Jan 11, 2024

+1,EggLogger 里加个。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants