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

调整puppet-service中的日志级别 #152

Closed
su-chang opened this issue Jul 29, 2021 · 3 comments
Closed

调整puppet-service中的日志级别 #152

su-chang opened this issue Jul 29, 2021 · 3 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@su-chang
Copy link
Member

目前该项目中的日志级别极大部分都是verbose的,对于默认打印info级别日志的情况,排查某些问题会有不便。

如果将使用wechaty的默认日志等级调整为verbose会有很多冗余的puppet-service日志,影响日志的可读性。

因此需要将一些关键日志的等级做出调整。

@su-chang su-chang mentioned this issue Jul 29, 2021
@huan
Copy link
Member

huan commented Aug 4, 2021

An internal module should never print messages to users because it should be "just works". If it has to print something, it must be an error message because there's anything not expected, or we told it to output debug messages.

The PuppetService is an internal module, so it should not print any message by default.
log.info

Just imagine that, for the TCP/IP OSI layers, if every layer prints log messages to you, then it will be totally a mess.

@huan huan added the wontfix This will not be worked on label Aug 4, 2021
@huan
Copy link
Member

huan commented Aug 4, 2021

A better way to achieve what you need, I believe is to add some events to the Brolog so that we can filter them.

For example:

log.on('verbose', (module, method, message) => {
  // filter module & method at here, and output whatever you want.
})

@huan huan added the enhancement New feature or request label Sep 8, 2021
@huan
Copy link
Member

huan commented Sep 8, 2021

Should be able to be solved by huan/brolog#145

Stay tuned.

@huan huan closed this as completed Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants