mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-22 03:30:35 +00:00
log: avoid setting default slog logger in init (#28747)
slog.SetDefault has undesirable side effects. It also sets the default logger destination, for example. So we should not call it by default in init.
This commit is contained in:
parent
76a5474b32
commit
c053eb71b6
@ -10,8 +10,7 @@ import (
|
||||
var root atomic.Value
|
||||
|
||||
func init() {
|
||||
defaultLogger := &logger{slog.New(DiscardHandler())}
|
||||
SetDefault(defaultLogger)
|
||||
root.Store(&logger{slog.New(DiscardHandler())})
|
||||
}
|
||||
|
||||
// SetDefault sets the default global logger
|
||||
|
Loading…
Reference in New Issue
Block a user