Documentation
¶
Overview ¶
Package logger provides structured logging with automatic secret redaction
Index ¶
- func Debug(msg string)
- func Error(msg string)
- func Fatal(msg string)
- func Info(msg string)
- func RedactSecret(secret string) string
- func SetGlobalLogger(logger *Logger)
- func Warn(msg string)
- type Config
- type Context
- type Event
- type Logger
- func (l *Logger) Debug(msg string)
- func (l *Logger) DebugEvent() *Event
- func (l *Logger) Error(msg string)
- func (l *Logger) ErrorEvent() *Event
- func (l *Logger) Fatal(msg string)
- func (l *Logger) Info(msg string)
- func (l *Logger) InfoEvent() *Event
- func (l *Logger) Warn(msg string)
- func (l *Logger) WarnEvent() *Event
- func (l *Logger) With() *Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RedactSecret ¶
RedactSecret redacts sensitive information from logs IMPORTANT: Never log raw secrets, keys, or shares
func SetGlobalLogger ¶
func SetGlobalLogger(logger *Logger)
SetGlobalLogger sets the global logger instance
Types ¶
type Config ¶
type Config struct {
// Level is the minimum log level (debug, info, warn, error)
Level string
// Output is where logs are written (default: os.Stdout)
Output io.Writer
// Pretty enables human-readable console output
Pretty bool
// TimeFormat for timestamps (default: RFC3339)
TimeFormat string
// CallerEnabled adds file and line number to logs
CallerEnabled bool
}
Config holds logger configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns default logger configuration
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context provides fluent API for adding fields to logs
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event represents a log event
Click to show internal directories.
Click to hide internal directories.