feat(log): Formatted console logging with file output
This commit is contained in:
12
logger.go
12
logger.go
@@ -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{}) {
|
||||
|
||||
Reference in New Issue
Block a user