Documentation
¶
Index ¶
- Constants
- func Debug(sender, format string, v ...any)
- func Debugf(format string, v ...any)
- func Error(sender, format string, v ...any)
- func Errorf(format string, v ...any)
- func Info(sender, format string, v ...any)
- func Infof(format string, v ...any)
- func Log(level LogLevel, sender string, format string, v ...any)
- func SetZerolog(opts ...OptFunc)
- func Warn(sender, format string, v ...any)
- func Warnf(format string, v ...any)
- type LogConfig
- type LogLevel
- type MultiWriter
- type OptFunc
Constants ¶
View Source
const IsoZonedDateTime = "2006-01-02 15:04:05"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogConfig ¶
type LogConfig struct {
LogLevel string `json:"log_level" yaml:"log_level"` // 日志级别
LogDir string `json:"log_dir" yaml:"log_dir"` // 日志文件路径
LogWithDate bool `json:"log_with_date" yaml:"log_with_date"` // 按日期存放日志
LogWithLevel bool `json:"log_with_level" yaml:"log_with_level"` // 按级别存放日志
LogWithColor bool `json:"log_with_color" yaml:"log_with_color"` // 是否输出彩色日志
LogWithConsole bool `json:"log_with_console" yaml:"log_with_console"` // 是否输出到控制台
LogSaveDay int `json:"log_save_day" yaml:"log_save_day"` // 保存时间,单位天
}
type MultiWriter ¶
type MultiWriter struct {
// contains filtered or unexported fields
}
func NewMultiWriter ¶
func NewMultiWriter(opts ...OptFunc) *MultiWriter
func (*MultiWriter) WriteLevel ¶
type OptFunc ¶
type OptFunc func(*MultiWriter) *MultiWriter
func WithFileName ¶
func WithLogConfig ¶
Click to show internal directories.
Click to hide internal directories.