Documentation
¶
Index ¶
- type Level
- type Logger
- type SimpleLogger
- func (l *SimpleLogger) Debug(msg string, args ...interface{})
- func (l *SimpleLogger) Error(msg string, args ...interface{})
- func (l *SimpleLogger) Fatal(msg string, args ...interface{})
- func (l *SimpleLogger) Info(msg string, args ...interface{})
- func (l *SimpleLogger) Warn(msg string, args ...interface{})
- func (l *SimpleLogger) WithModule(module string) Logger
- type TestLogger
- func (l *TestLogger) Debug(msg string, args ...interface{})
- func (l *TestLogger) Error(msg string, args ...interface{})
- func (l *TestLogger) Fatal(msg string, args ...interface{})
- func (l *TestLogger) Info(msg string, args ...interface{})
- func (l *TestLogger) Warn(msg string, args ...interface{})
- func (l *TestLogger) WithModule(module string) Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Debug(msg string, args ...interface{})
Info(msg string, args ...interface{})
Warn(msg string, args ...interface{})
Error(msg string, args ...interface{})
Fatal(msg string, args ...interface{})
WithModule(module string) Logger
}
Logger is the interface for logging
type SimpleLogger ¶
type SimpleLogger struct {
// contains filtered or unexported fields
}
SimpleLogger is a basic logger implementation
func NewSimpleLogger ¶
func NewSimpleLogger(module string, level Level, useColors bool) *SimpleLogger
NewSimpleLogger creates a new SimpleLogger
func (*SimpleLogger) Debug ¶
func (l *SimpleLogger) Debug(msg string, args ...interface{})
Debug logs a debug message
func (*SimpleLogger) Error ¶
func (l *SimpleLogger) Error(msg string, args ...interface{})
Error logs an error message
func (*SimpleLogger) Fatal ¶
func (l *SimpleLogger) Fatal(msg string, args ...interface{})
Fatal logs a fatal error message and exits
func (*SimpleLogger) Info ¶
func (l *SimpleLogger) Info(msg string, args ...interface{})
Info logs an informational message
func (*SimpleLogger) Warn ¶
func (l *SimpleLogger) Warn(msg string, args ...interface{})
Warn logs a warning message
func (*SimpleLogger) WithModule ¶
func (l *SimpleLogger) WithModule(module string) Logger
WithModule creates a new logger with a hierarchical component name. If the current logger already has a component (module), the new component is appended with "/" as a separator (e.g., "proxy/middleware/session"). This allows tracing the origin of log messages through component hierarchy.
type TestLogger ¶
type TestLogger struct {
// contains filtered or unexported fields
}
TestLogger is a logger for testing that suppresses output
func NewTestLogger ¶
func NewTestLogger() *TestLogger
NewTestLogger creates a new test logger that suppresses output If you need to see logs during tests, use NewTestLoggerVerbose instead
func NewTestLoggerVerbose ¶
func NewTestLoggerVerbose(t *testing.T) *TestLogger
NewTestLoggerVerbose creates a test logger that outputs to testing.T
func (*TestLogger) Debug ¶
func (l *TestLogger) Debug(msg string, args ...interface{})
Debug logs a debug message
func (*TestLogger) Error ¶
func (l *TestLogger) Error(msg string, args ...interface{})
Error logs an error message
func (*TestLogger) Fatal ¶
func (l *TestLogger) Fatal(msg string, args ...interface{})
Fatal logs a fatal error message (but doesn't exit in tests)
func (*TestLogger) Info ¶
func (l *TestLogger) Info(msg string, args ...interface{})
Info logs an informational message
func (*TestLogger) Warn ¶
func (l *TestLogger) Warn(msg string, args ...interface{})
Warn logs a warning message
func (*TestLogger) WithModule ¶
func (l *TestLogger) WithModule(module string) Logger
WithModule creates a new logger with a hierarchical component name. If the current logger already has a component (module), the new component is appended with "/" as a separator (e.g., "proxy/middleware/session").