Documentation ¶
Index ¶
- func AddField(k string, v interface{})
- func AnyToString(raw interface{}) string
- func Bool(e interface{}) bool
- func Debug(e interface{}, args ...interface{}) error
- func Debugf(format string, args ...interface{}) error
- func Error(e interface{}, args ...interface{}) error
- func Errorf(format string, args ...interface{}) error
- func Fatal(e interface{}, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func GetLevel() string
- func Info(e interface{}, args ...interface{}) error
- func Infof(format string, args ...interface{}) error
- func InitDefaultLogger(cfg *LogConfig)
- func Panic(e interface{}, args ...interface{})
- func Panicf(format string, args ...interface{})
- func SetLevel(lvl string)
- func Warn(e interface{}, args ...interface{}) error
- func Warnf(format string, args ...interface{}) error
- type Fields
- type LogConfig
- type LogX
- func (l *LogX) DPanic(s interface{}, args ...interface{})
- func (l *LogX) DPanicf(msg string, args ...interface{}) error
- func (l *LogX) Debug(s interface{}, args ...interface{}) error
- func (l *LogX) Debugf(msg string, args ...interface{}) error
- func (l *LogX) Error(s interface{}, args ...interface{}) error
- func (l *LogX) Errorf(msg string, args ...interface{}) error
- func (l *LogX) Fatal(s interface{}, args ...interface{})
- func (l *LogX) Fatalf(msg string, args ...interface{})
- func (l *LogX) Info(s interface{}, args ...interface{}) error
- func (l *LogX) Infof(msg string, args ...interface{}) error
- func (l *LogX) LogError(err error) error
- func (l *LogX) Panic(s interface{}, args ...interface{})
- func (l *LogX) Panicf(msg string, args ...interface{})
- func (l *LogX) Warn(s interface{}, args ...interface{}) error
- func (l *LogX) Warnf(msg string, args ...interface{}) error
- type Syncer
- type WriteSyncer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyToString ¶
func AnyToString(raw interface{}) string
func InitDefaultLogger ¶
func InitDefaultLogger(cfg *LogConfig)
InitDefaultLogger initial standard log, if you don't init, it will use default logger setting
Types ¶
type LogConfig ¶
type LogConfig struct { AppName string `yaml:"app_name" json:"app_name" toml:"app_name"` Level string `yaml:"level" json:"level" toml:"level"` StacktraceLevel string `yaml:"stacktrace_level" json:"stacktrace_level" toml:"stacktrace_level"` IsStdOut bool `yaml:"is_stdout" json:"is_stdout" toml:"is_stdout"` IsStdErr bool `yaml:"is_stderr" json:"is_stderr" toml:"is_stderr"` TimeFormat string `yaml:"time_format" json:"time_format" toml:"time_format"` // second, milli, nano, standard, iso, Encoding string `yaml:"encoding" json:"encoding" toml:"encoding"` // console, json Skip int `yaml:"skip" json:"skip" toml:"skip"` IsFileOut bool `yaml:"is_file_out" json:"is_file_out" toml:"is_file_out"` FileDir string `yaml:"file_dir" json:"file_dir" toml:"file_dir"` FileName string `yaml:"file_name" json:"file_name" toml:"file_name"` FileMaxSize int `yaml:"file_max_size" json:"file_max_size" toml:"file_max_size"` // MB FileMaxAge int `yaml:"file_max_age" json:"file_max_age" toml:"file_max_age"` // Days FileMaxBackup int `yaml:"file_max_backup" json:"file_max_backup" toml:"file_max_backup"` }
type WriteSyncer ¶
WriteSyncer output interface
func NewRollingFile ¶
func NewRollingFile(dir, filename string, maxSize, maxAge, maxBackups int) WriteSyncer
NewRollingFile split writer
Click to show internal directories.
Click to hide internal directories.