Documentation
¶
Index ¶
- Constants
- func Debug(ctx context.Context, msg string, err error, fields KV)
- func Error(ctx context.Context, msg string, err error, fields KV)
- func Fatal(ctx context.Context, msg string, err error, fields KV)
- func Info(ctx context.Context, msg string, err error, fields KV)
- func Panic(ctx context.Context, msg string, err error, fields KV)
- func Print(msg string)
- func Printf(msg string, v ...any)
- func SetLogger(log Log)
- func Trace(ctx context.Context, msg string, err error, fields KV)
- func Warn(ctx context.Context, msg string, err error, fields KV)
- type Config
- type KV
- type Log
- type LogLevel
- type LogTimeFormat
- type Output
Constants ¶
View Source
const ( LogLevelUnknown = iota LogLevelTrace LogLevelDebug LogLevelInfo LogLevelWarn LogLevelError LogLevelPanic LogLevelFatal )
View Source
const ( LogTimeFormatDisable = iota LogTimeFormatUnix LogTimeFormatTimestamp )
View Source
const ( OutputStdout = iota OutputStderr OutputFile )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
LogLevel LogLevel
TimeFormat LogTimeFormat
OutputType Output
OutputFilePath string // only if output type is set to OutputFile
}
type Log ¶
type Log interface {
Print(msg string)
Printf(msg string, v ...any)
Trace(ctx context.Context, msg string, err error, fields KV)
Info(ctx context.Context, msg string, err error, fields KV)
Warn(ctx context.Context, msg string, err error, fields KV)
Error(ctx context.Context, msg string, err error, fields KV)
Debug(ctx context.Context, msg string, err error, fields KV)
Panic(ctx context.Context, msg string, err error, fields KV)
Fatal(ctx context.Context, msg string, err error, fields KV)
}
func NewZerolog ¶
type LogTimeFormat ¶
type LogTimeFormat int
Click to show internal directories.
Click to hide internal directories.