Documentation
¶
Index ¶
- type Field
- func Any(key string, val interface{}) Field
- func Bool(key string, val bool) Field
- func ByteString(key string, val []byte) Field
- func Duration(key string, val time.Duration) Field
- func Error(err error) Field
- func Float32(key string, val float32) Field
- func Float64(key string, val float64) Field
- func Int(key string, val int) Field
- func Int16(key string, val int16) Field
- func Int32(key string, val int32) Field
- func Int64(key string, val int64) Field
- func Int8(key string, val int8) Field
- func String(key string, val string) Field
- func Stringer(key string, val fmt.Stringer) Field
- func Time(key string, val time.Time) Field
- func Uint(key string, val uint) Field
- func Uint16(key string, val uint16) Field
- func Uint32(key string, val uint32) Field
- func Uint64(key string, val uint64) Field
- func Uint8(key string, val uint8) Field
- type FieldType
- type Logger
- type LoggingLevel
- type SugaredLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
Field represents a key-value pair for structured logging. It wraps zap.Field internally but provides a zap-independent interface.
func ByteString ¶
type Logger ¶
type Logger interface {
Debug(msg string, fields ...Field)
Info(msg string, fields ...Field)
Warn(msg string, fields ...Field)
Error(msg string, fields ...Field)
Panic(msg string, fields ...Field)
Fatal(msg string, fields ...Field)
// Sugar returns a sugared logger for printf-style APIs
Sugar() SugaredLogger
}
Logger is the interface that wraps the basic logging methods. It is designed to be a drop-in replacement for *zap.Logger.
func GetLogger ¶
func GetLogger(level LoggingLevel, disableLogToConsole bool, filename string) (Logger, error)
func MustGetTestLogger ¶
func MustGetTestLogger() Logger
func NewZapAdapter ¶
NewZapAdapter creates a new Logger that wraps the given *zap.Logger.
type SugaredLogger ¶
type SugaredLogger interface {
Panicf(template string, args ...interface{})
}
SugaredLogger provides a more ergonomic, printf-style API.
Click to show internal directories.
Click to hide internal directories.