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

能不能关掉所有的logs #39

Open
xmsama opened this issue Jan 13, 2023 · 4 comments
Open

能不能关掉所有的logs #39

xmsama opened this issue Jan 13, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@xmsama
Copy link

xmsama commented Jan 13, 2023

No description provided.

@lqqyt2423
Copy link
Owner

不能,你可以fork出来,你自己修改代码

@HumXC
Copy link

HumXC commented May 1, 2023

请求增加一个日志接口,作为一个包使用的话,不同风格的日志混一起,就很难受了。保存日志什么的也是没法做到

@HumXC
Copy link

HumXC commented May 1, 2023

No description provided.

如果你不需要所有的日志,可以将 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 输出的日志了

@lqqyt2423
Copy link
Owner

欢迎提pr

@lqqyt2423 lqqyt2423 added the enhancement New feature or request label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants