mirror of
https://github.com/r-smith/deceptifeed.git
synced 2025-10-23 08:22:21 +00:00
Use slog.DiscardHandler when logging is disabled
This change switches to using slog.DiscardHandler, added to Go 1.24, when logging is disabled.
This commit is contained in:
@@ -211,7 +211,7 @@ func (c *Config) InitializeLoggers() error {
|
||||
|
||||
// If no log path is specified or if logging is disabled, discard logs.
|
||||
if len(logPath) == 0 || !c.Servers[i].LogEnabled {
|
||||
c.Servers[i].Logger = slog.New(slog.NewTextHandler(io.Discard, nil))
|
||||
c.Servers[i].Logger = slog.New(slog.DiscardHandler)
|
||||
continue
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user