Documentation
¶
Index ¶
- func Is(e error, kargs ...string) bool
- type Config
- type Error
- type Log
- type Logger
- func (l Logger) ErrorF(status map[int][]string, format string, args ...any) *Error
- func (l Logger) Fatal(format string, args ...any)
- func (l Logger) Info(format string, args ...any) *Log
- func (l Logger) LogF(statusCode int, format string, args ...any) *Log
- func (l *Logger) RunWithRetries(status map[int][]string, f func() error) *Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Format string // json, text, csv
Level int // 100: DEBUG, 200: INFO, 300: NOTICE, 400: WARNING, 500: ERROR, 502: CRITICAL, 509: ALERT
Output string // stdout, <filepath>
Retries int
Wait time.Duration
}
Config represents the configuration for the logger.
type Error ¶
type Error struct {
UUID string `json:"uuid"`
Status int `json:"-"`
Message string `json:"message"`
}
Error represents an error with a UUID, status, and message.
type Log ¶
type Log struct {
Timestamp string `json:"timestamp"`
Severity string `json:"severity"`
Path string `json:"path"`
Line int `json:"line"`
Error
}
Log represents a log entry.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represents a logger instance.
func NewLogger ¶ added in v1.0.3
NewLogger creates a new logger instance with the given configuration.
func (Logger) ErrorF ¶
ErrorF logs an error message with the given status code and arguments. It returns an error object.
Click to show internal directories.
Click to hide internal directories.