We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
log1 := logger.NewLogger() log2 := logger.NewLogger() log1.SetLogger("file", "{"filename":"log1.log"}") log2.SetLogger("file", "{"filename":"log2.log"}") log1.Info("log1") log2.Info("log2") 此时log1,log2都将输出到log2.log 原因是 var adapters = make(map[string]Logger) 调用Register时传入的是指针,SetLogger中logger, ok := adapters[adapterName],就会修改adapters 只会有一个file适配器生效
The text was updated successfully, but these errors were encountered:
No branches or pull requests
log1 := logger.NewLogger()
log2 := logger.NewLogger()
log1.SetLogger("file", "{"filename":"log1.log"}")
log2.SetLogger("file", "{"filename":"log2.log"}")
log1.Info("log1")
log2.Info("log2")
此时log1,log2都将输出到log2.log
原因是
var adapters = make(map[string]Logger)
调用Register时传入的是指针,SetLogger中logger, ok := adapters[adapterName],就会修改adapters
只会有一个file适配器生效
The text was updated successfully, but these errors were encountered: