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

Function GetPackageLoggerConcrete

internal/logger/logger.go:316–324  ·  view source on GitHub ↗

GetPackageLoggerConcrete returns a concrete Logger instance for packages that need the specific type This ensures all packages log to the same unified log file while maintaining type compatibility.

(packageName string)

Source from the content-addressed store, hash-verified

314// GetPackageLoggerConcrete returns a concrete Logger instance for packages that need the specific type
315// This ensures all packages log to the same unified log file while maintaining type compatibility.
316func GetPackageLoggerConcrete(packageName string) *Logger {
317 // Attempt to return the global logger as a concrete type when possible.
318 if lg, ok := GetGlobalLogger().(*Logger); ok {
319 return lg
320 }
321
322 // Fallback: create a simple logger to avoid nil.
323 return NewSimpleLogger(LevelInfo)
324}

Callers 4

NewServerWithLoggerFunction · 0.92
NewServiceWithLoggerFunction · 0.92

Calls 2

GetGlobalLoggerFunction · 0.85
NewSimpleLoggerFunction · 0.85

Tested by

no test coverage detected