Documentation
¶
Index ¶
- func Debug(message string, fields ...map[string]interface{})
- func Error(message string, fields ...map[string]interface{})
- func Fatal(message string, fields ...map[string]interface{})
- func Info(message string, fields ...map[string]interface{})
- func SetGlobalLevel(level Level)
- func Warn(message string, fields ...map[string]interface{})
- type Level
- type LogEntry
- type Logger
- func (l *Logger) Debug(message string, fields ...map[string]interface{})
- func (l *Logger) Error(message string, fields ...map[string]interface{})
- func (l *Logger) Fatal(message string, fields ...map[string]interface{})
- func (l *Logger) Info(message string, fields ...map[string]interface{})
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) Warn(message string, fields ...map[string]interface{})
- func (l *Logger) WithFields(fields map[string]interface{}) *LoggerWithFields
- type LoggerWithFields
- func (l *LoggerWithFields) Debug(message string, fields ...map[string]interface{})
- func (l *LoggerWithFields) Error(message string, fields ...map[string]interface{})
- func (l *LoggerWithFields) Fatal(message string, fields ...map[string]interface{})
- func (l *LoggerWithFields) Info(message string, fields ...map[string]interface{})
- func (l *LoggerWithFields) Warn(message string, fields ...map[string]interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogEntry ¶
type LogEntry struct {
Timestamp string `json:"timestamp"`
Level string `json:"level"`
Message string `json:"message"`
Service string `json:"service"`
Function string `json:"function,omitempty"`
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
Fields map[string]interface{} `json:"fields,omitempty"`
}
LogEntry represents a structured log entry
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represents a structured logger
func NewLoggerWithWriter ¶
NewLoggerWithWriter creates a new logger with a custom writer
func (*Logger) WithFields ¶
func (l *Logger) WithFields(fields map[string]interface{}) *LoggerWithFields
WithFields returns a logger with additional fields
type LoggerWithFields ¶
type LoggerWithFields struct {
// contains filtered or unexported fields
}
LoggerWithFields represents a logger with predefined fields
func (*LoggerWithFields) Debug ¶
func (l *LoggerWithFields) Debug(message string, fields ...map[string]interface{})
Debug logs a debug message with predefined fields
func (*LoggerWithFields) Error ¶
func (l *LoggerWithFields) Error(message string, fields ...map[string]interface{})
Error logs an error message with predefined fields
func (*LoggerWithFields) Fatal ¶
func (l *LoggerWithFields) Fatal(message string, fields ...map[string]interface{})
Fatal logs a fatal message with predefined fields and exits
func (*LoggerWithFields) Info ¶
func (l *LoggerWithFields) Info(message string, fields ...map[string]interface{})
Info logs an info message with predefined fields
func (*LoggerWithFields) Warn ¶
func (l *LoggerWithFields) Warn(message string, fields ...map[string]interface{})
Warn logs a warning message with predefined fields
Click to show internal directories.
Click to hide internal directories.