Documentation
¶
Index ¶
- type GlobalCallOptimizer
- type Level
- type Logger
- type NoOpLogger
- func (n *NoOpLogger) Debug(args ...interface{})
- func (n *NoOpLogger) Debugf(template string, args ...interface{})
- func (n *NoOpLogger) Debugw(msg string, keysAndValues ...interface{})
- func (n *NoOpLogger) Error(args ...interface{})
- func (n *NoOpLogger) Errorf(template string, args ...interface{})
- func (n *NoOpLogger) Errorw(msg string, keysAndValues ...interface{})
- func (n *NoOpLogger) Fatal(args ...interface{})
- func (n *NoOpLogger) Fatalf(template string, args ...interface{})
- func (n *NoOpLogger) Fatalw(msg string, keysAndValues ...interface{})
- func (n *NoOpLogger) Flush() error
- func (n *NoOpLogger) GetLastError() error
- func (n *NoOpLogger) Info(args ...interface{})
- func (n *NoOpLogger) Infof(template string, args ...interface{})
- func (n *NoOpLogger) Infow(msg string, keysAndValues ...interface{})
- func (n *NoOpLogger) SetLevel(level Level)
- func (n *NoOpLogger) Warn(args ...interface{})
- func (n *NoOpLogger) Warnf(template string, args ...interface{})
- func (n *NoOpLogger) Warnw(msg string, keysAndValues ...interface{})
- func (n *NoOpLogger) With(keyValues ...interface{}) Logger
- func (n *NoOpLogger) WithCallerSkip(skip int) Logger
- func (n *NoOpLogger) WithCtx(ctx context.Context, keyValues ...interface{}) Logger
- type ParseLevelError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlobalCallOptimizer ¶ added in v0.2.0
type GlobalCallOptimizer interface {
// CreateGlobalCallLogger returns a logger optimized for global function calls
CreateGlobalCallLogger() Logger
}
GlobalCallOptimizer is an internal interface for engines that support optimized global call logging to avoid runtime call stack detection.
type Level ¶
type Level int8
Level represents the logging level.
const ( // DebugLevel logs are typically voluminous, and are usually disabled in production. DebugLevel Level = iota - 1 // InfoLevel is the default logging priority. InfoLevel // WarnLevel logs are more important than Info, but don't need individual human review. WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel // FatalLevel logs a message, then calls os.Exit(1). FatalLevel )
func ParseLevel ¶
ParseLevel parses a level based on the lower-case or all-caps ASCII representation of the log level. If the provided ASCII representation is invalid an error is returned.
type Logger ¶
type Logger interface {
// Basic logging methods with variadic arguments
Debug(args ...interface{})
Info(args ...interface{})
Warn(args ...interface{})
Error(args ...interface{})
Fatal(args ...interface{})
// Printf-style logging methods with format templates
Debugf(template string, args ...interface{})
Infof(template string, args ...interface{})
Warnf(template string, args ...interface{})
Errorf(template string, args ...interface{})
Fatalf(template string, args ...interface{})
// Structured logging methods with key-value pairs
Debugw(msg string, keysAndValues ...interface{})
Infow(msg string, keysAndValues ...interface{})
Warnw(msg string, keysAndValues ...interface{})
Errorw(msg string, keysAndValues ...interface{})
Fatalw(msg string, keysAndValues ...interface{})
// Logger enhancement methods
With(keyValues ...interface{}) Logger
WithCtx(ctx context.Context, keyValues ...interface{}) Logger
WithCallerSkip(skip int) Logger
// Configuration methods
SetLevel(level Level)
// Buffer management methods
Flush() error
}
Logger defines the standard logging interface used throughout the application. It provides structured logging capabilities with context support and multiple output formats.
func NewNoOpLogger ¶ added in v0.2.0
NewNoOpLogger creates a new no-operation logger.
type NoOpLogger ¶ added in v0.2.0
type NoOpLogger struct {
// contains filtered or unexported fields
}
NoOpLogger implements Logger interface but performs no actual logging. Used as a fallback when logger creation fails to prevent application crashes.
func (*NoOpLogger) Debug ¶ added in v0.2.0
func (n *NoOpLogger) Debug(args ...interface{})
Basic logging methods - all no-op
func (*NoOpLogger) Debugf ¶ added in v0.2.0
func (n *NoOpLogger) Debugf(template string, args ...interface{})
Printf-style methods - all no-op
func (*NoOpLogger) Debugw ¶ added in v0.2.0
func (n *NoOpLogger) Debugw(msg string, keysAndValues ...interface{})
Structured logging methods - all no-op
func (*NoOpLogger) Error ¶ added in v0.2.0
func (n *NoOpLogger) Error(args ...interface{})
func (*NoOpLogger) Errorf ¶ added in v0.2.0
func (n *NoOpLogger) Errorf(template string, args ...interface{})
func (*NoOpLogger) Errorw ¶ added in v0.2.0
func (n *NoOpLogger) Errorw(msg string, keysAndValues ...interface{})
func (*NoOpLogger) Fatal ¶ added in v0.2.0
func (n *NoOpLogger) Fatal(args ...interface{})
func (*NoOpLogger) Fatalf ¶ added in v0.2.0
func (n *NoOpLogger) Fatalf(template string, args ...interface{})
func (*NoOpLogger) Fatalw ¶ added in v0.2.0
func (n *NoOpLogger) Fatalw(msg string, keysAndValues ...interface{})
func (*NoOpLogger) Flush ¶ added in v0.2.0
func (n *NoOpLogger) Flush() error
Buffer management - always returns nil
func (*NoOpLogger) GetLastError ¶ added in v0.2.0
func (n *NoOpLogger) GetLastError() error
GetLastError returns the last error that caused this no-op logger to be created.
func (*NoOpLogger) Info ¶ added in v0.2.0
func (n *NoOpLogger) Info(args ...interface{})
func (*NoOpLogger) Infof ¶ added in v0.2.0
func (n *NoOpLogger) Infof(template string, args ...interface{})
func (*NoOpLogger) Infow ¶ added in v0.2.0
func (n *NoOpLogger) Infow(msg string, keysAndValues ...interface{})
func (*NoOpLogger) SetLevel ¶ added in v0.2.0
func (n *NoOpLogger) SetLevel(level Level)
Configuration methods - no-op
func (*NoOpLogger) Warn ¶ added in v0.2.0
func (n *NoOpLogger) Warn(args ...interface{})
func (*NoOpLogger) Warnf ¶ added in v0.2.0
func (n *NoOpLogger) Warnf(template string, args ...interface{})
func (*NoOpLogger) Warnw ¶ added in v0.2.0
func (n *NoOpLogger) Warnw(msg string, keysAndValues ...interface{})
func (*NoOpLogger) With ¶ added in v0.2.0
func (n *NoOpLogger) With(keyValues ...interface{}) Logger
Enhancement methods - return self to maintain chain
func (*NoOpLogger) WithCallerSkip ¶ added in v0.2.0
func (n *NoOpLogger) WithCallerSkip(skip int) Logger
type ParseLevelError ¶
type ParseLevelError struct {
// contains filtered or unexported fields
}
ParseLevelError is returned when parsing an invalid level string.
func (*ParseLevelError) Error ¶
func (e *ParseLevelError) Error() string