Documentation
¶
Overview ¶
Package logging provides structured logging for JVS. It supports multiple log levels and field-based logging.
Index ¶
- func Debug(msg string, fields ...map[string]any)
- func Error(msg string, fields ...map[string]any)
- func ErrorErr(msg string, err error, fields ...map[string]any)
- func Info(msg string, fields ...map[string]any)
- func SetGlobal(l *Logger)
- func Warn(msg string, fields ...map[string]any)
- type Level
- type LogEntry
- type Logger
- func (l *Logger) Debug(msg string, fields ...map[string]any)
- func (l *Logger) Error(msg string, fields ...map[string]any)
- func (l *Logger) ErrorErr(msg string, err error, fields ...map[string]any)
- func (l *Logger) Info(msg string, fields ...map[string]any)
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) Warn(msg string, fields ...map[string]any)
- func (l *Logger) WithFields(fields map[string]any) *Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogEntry ¶
type LogEntry struct {
Timestamp string `json:"timestamp"`
Level Level `json:"level"`
Message string `json:"message"`
Fields map[string]any `json:"fields,omitempty"`
}
LogEntry represents a structured log entry.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides structured logging.
func WithFields ¶
WithFields returns a new logger from global with additional fields.
Click to show internal directories.
Click to hide internal directories.