MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / InitGlobalLogger

Function InitGlobalLogger

internal/logger/logger.go:238–251  ·  view source on GitHub ↗

InitGlobalLogger initializes the global logger with the specified cache directory This should be called early in application initialization.

(level Level, cacheDir string)

Source from the content-addressed store, hash-verified

236// InitGlobalLogger initializes the global logger with the specified cache directory
237// This should be called early in application initialization.
238func InitGlobalLogger(level Level, cacheDir string) error {
239 var err error
240
241 globalLoggerOnce.Do(func() {
242 // Try to create internal logger with file output
243 globalLogger, err = NewInternalLogger(level, cacheDir)
244 if err != nil {
245 // Fallback to simple logger if file logging fails
246 globalLogger = NewSimpleLogger(level)
247 }
248 })
249
250 return err
251}
252
253// InitGlobalLoggerWithValidation initializes the global logger with cache directory validation
254// This is a convenience function that validates the cache directory before initializing.

Callers 2

Calls 2

NewInternalLoggerFunction · 0.85
NewSimpleLoggerFunction · 0.85

Tested by

no test coverage detected