-
Notifications
You must be signed in to change notification settings - Fork 206
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
能不能关掉所有的logs #39
Labels
enhancement
New feature or request
Comments
不能,你可以fork出来,你自己修改代码 |
请求增加一个日志接口,作为一个包使用的话,不同风格的日志混一起,就很难受了。保存日志什么的也是没法做到 |
如果你不需要所有的日志,可以将 logrus 的输出位置改成 devnull import log "github.com/sirupsen/logrus"
func init() {
null, err := os.OpenFile(os.DevNull, os.O_WRONLY, 0)
if err != nil {
panic(err)
}
log.SetOutput(null)
} 这样就看不到 logrus 输出的日志了 |
欢迎提pr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: