feat(log): Formatted console logging with file output

This commit is contained in:
Björn Benouarets
2025-11-10 05:25:29 +01:00
parent 7b3c176d20
commit 764945c07e
3 changed files with 171 additions and 21 deletions

View File

@@ -185,6 +185,18 @@ func (l *MasterLogger) Error(message string, fields ...map[string]interface{}) {
// Default logger instance
var defaultLogger = New(LevelInfo)
// SetDefaultLogger replaces the default logger instance
// This allows you to configure a custom logger and use it globally
func SetDefaultLogger(logger *MasterLogger) {
defaultLogger = logger
}
// GetDefaultLogger returns the current default logger instance
// Useful if you want to configure it directly
func GetDefaultLogger() *MasterLogger {
return defaultLogger
}
// Package-level convenience functions
// These collect caller info before calling the instance method
func Trace(message string, fields ...map[string]interface{}) {