SetDebugEnabled sets the global debug flag for the logger package. This should be called during application initialization to enable debug logging.
(enabled bool)
| 294 | // SetDebugEnabled sets the global debug flag for the logger package. |
| 295 | // This should be called during application initialization to enable debug logging. |
| 296 | func SetDebugEnabled(enabled bool) { |
| 297 | // Elevate global logger level if already initialized. |
| 298 | if lg, ok := globalLogger.(*Logger); ok { |
| 299 | if enabled { |
| 300 | lg.SetLevel(LevelDebug) |
| 301 | } else { |
| 302 | lg.SetLevel(LevelInfo) |
| 303 | } |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | // GetPackageLogger returns a logger for a specific package using the global cache directory |
| 308 | // This ensures all packages log to the same unified log file. |
no test coverage detected