mirror of
https://github.com/golang/go
synced 2024-11-18 23:05:06 -07:00
log/slog: use atomic.Pointer instead of atomic.Value
This commit is contained in:
parent
d5c5808534
commit
577902519f
@ -14,14 +14,14 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var defaultLogger atomic.Value
|
||||
var defaultLogger atomic.Pointer[Logger]
|
||||
|
||||
func init() {
|
||||
defaultLogger.Store(New(newDefaultHandler(loginternal.DefaultOutput)))
|
||||
}
|
||||
|
||||
// Default returns the default Logger.
|
||||
func Default() *Logger { return defaultLogger.Load().(*Logger) }
|
||||
func Default() *Logger { return defaultLogger.Load() }
|
||||
|
||||
// SetDefault makes l the default Logger.
|
||||
// After this call, output from the log package's default Logger
|
||||
|
Loading…
Reference in New Issue
Block a user