chore: let logx.SetWriter can be called anytime (#2186)

This commit is contained in:
Kevin Wan
2022-07-24 14:15:57 +08:00
committed by GitHub
parent 685d14e662
commit 9b334b5428
3 changed files with 5 additions and 8 deletions

View File

@@ -199,11 +199,8 @@ func SetLevel(level uint32) {
}
// SetWriter sets the logging writer. It can be used to customize the logging.
// Call Reset before calling SetWriter again.
func SetWriter(w Writer) {
if writer.Load() == nil {
writer.Store(w)
}
writer.Store(w)
}
// SetUp sets up the logx. If already set up, just return nil.