Documentation
¶
Index ¶
- Constants
- type CompatLogger
- func (c *CompatLogger) ClearParameters()
- func (c *CompatLogger) Log(level core.LogLevel, eventType string, eventData map[string]any, ...)
- func (c *CompatLogger) SetLevel(level core.LogLevel)
- func (c *CompatLogger) SetOutput(output *os.File)
- func (c *CompatLogger) SetParameters(params map[string]any)
- func (c *CompatLogger) SetPrettyPrint(enabled bool)
Constants ¶
const ( LogLevel_Trace = core.LevelTrace LogLevel_Debug = core.LevelDebug LogLevel_Info = core.LevelInfo LogLevel_Warn = core.LevelWarn LogLevel_Error = core.LevelError LogLevel_Fatal = core.LevelFatal )
Backward compatible log level constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompatLogger ¶
type CompatLogger struct {
// contains filtered or unexported fields
}
CompatLogger provides backward compatibility with the old logger API
func GetLogger ¶
func GetLogger(serviceName string) *CompatLogger
GetLogger returns a logger instance for the given service name. This function provides backward compatibility with the old API. For new code, prefer using New() directly.
func NewCompatLogger ¶
func NewCompatLogger(coreLogger *core.Logger) *CompatLogger
NewCompatLogger creates a new CompatLogger with the given logger This is primarily for testing purposes
func (*CompatLogger) ClearParameters ¶
func (c *CompatLogger) ClearParameters()
ClearParameters clears all persistent parameters
func (*CompatLogger) Log ¶
func (c *CompatLogger) Log(level core.LogLevel, eventType string, eventData map[string]any, traceData map[string]any)
Log logs a message with the given level, event type, event data, and trace data. This function provides backward compatibility with the old API.
Parameters:
- level: LogLevel (use LogLevel_Debug, LogLevel_Info, etc.)
- eventType: string describing the event type
- eventData: map containing event-specific data (message should be in eventData["message"])
- traceData: map containing trace information (id should be in traceData["id"])
func (*CompatLogger) SetLevel ¶
func (c *CompatLogger) SetLevel(level core.LogLevel)
SetLevel sets the log level for this logger
func (*CompatLogger) SetOutput ¶
func (c *CompatLogger) SetOutput(output *os.File)
SetOutput sets the output writer for this logger
func (*CompatLogger) SetParameters ¶
func (c *CompatLogger) SetParameters(params map[string]any)
SetParameters sets persistent parameters that will be included in all subsequent log entries
func (*CompatLogger) SetPrettyPrint ¶
func (c *CompatLogger) SetPrettyPrint(enabled bool)
SetPrettyPrint enables or disables pretty printing
Source Files
¶
- compat.go