Documentation ¶
Index ¶
- Constants
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func NewLogger(options ...LogOption) error
- func Panicf(format string, args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type Fields
- type LogOption
- func WithBackUpCount(n uint) LogOption
- func WithErrorFile(f string) LogOption
- func WithFile(f string) LogOption
- func WithFormatText(b bool) LogOption
- func WithLevel(l string) LogOption
- func WithName(n string) LogOption
- func WithRollingPolicy(r string) LogOption
- func WithRotateDate(d int) LogOption
- func WithRotateSize(s int) LogOption
- func WithWarnFile(f string) LogOption
- func WithWriters(w string) LogOption
- type Logger
Constants ¶
View Source
const ( // RotateTimeDaily 默认按天切割 RotateTimeDaily = "daily" // RotateTimeHourly 按小时切割 RotateTimeHourly = "hourly" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogOption ¶
type LogOption func(zl *zapLogger)
LogOption 日志配置项
func WithRollingPolicy ¶
WithRollingPolicy 日志切割方式, daily: 每24小时切割; hourly: 每小时切割
func WithWriters ¶
WithWriters 日志输出流, file: 只输出到文件; stdout: 只输出到标准输出流; file,stdout: 同时输出到文件和标准输出流
type Logger ¶
type Logger interface { Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{}) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) Panicf(format string, args ...interface{}) WithFields(fields Fields) Logger }
func WithFields ¶
Click to show internal directories.
Click to hide internal directories.