Documentation
¶
Index ¶
- func Debug(msg string, attrs ...any)
- func Debugf(format string, args ...any)
- func Error(msg string, attrs ...any)
- func Errorf(format string, args ...any)
- func Info(msg string, attrs ...any)
- func Infof(format string, args ...any)
- func Init(config *Config, attrs map[string]any)
- func NewSlogLogger(config *Config, options ...Option) *slog.Logger
- func Sync() error
- func Warn(msg string, attrs ...any)
- func Warnf(format string, args ...any)
- type AddCallerStatus
- type BaseLogger
- type Config
- type ConsoleConfig
- type Field
- func Any(key string, value interface{}) Field
- func Bool(key string, value bool) Field
- func Duration(key string, value time.Duration) Field
- func Err(err error) Field
- func Float64(key string, value float64) Field
- func Group(key string, values ...any) Field
- func Int(key string, value int) Field
- func Int64(key string, value int64) Field
- func String(key, value string) Field
- func Time(key string, value time.Time) Field
- func Uint64(key string, value uint64) Field
- type FileConfig
- type Logger
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddCallerStatus ¶
type AddCallerStatus int
const ( AddCallerStatusKeep AddCallerStatus = iota AddCallerStatusEnable AddCallerStatusDisable )
type BaseLogger ¶
type Config ¶
type Config struct {
File *FileConfig `json:"file" yaml:"file"`
Console *ConsoleConfig `json:"console" yaml:"console"`
Level string `json:"level" yaml:"level"`
}
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type ConsoleConfig ¶
type ConsoleConfig struct {
Disable bool `json:"disable" yaml:"disable"`
}
type FileConfig ¶
type Logger ¶
type Option ¶
type Option = func(*options)
func AddCallerSkip ¶
func DisableCaller ¶
func DisableCaller() Option
func WithStackAt ¶
Click to show internal directories.
Click to hide internal directories.