mirror of
				https://github.com/r-smith/deceptifeed.git
				synced 2025-11-03 21:53:39 +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