Documentation ¶
Index ¶
- Variables
- type LogOption
- type Logger
- func (l *Logger) Debug(msg string)
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(msg string)
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Info(msg string)
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Name(name string) Logger
- func (l *Logger) Trace(traceId string) *Logger
- func (l *Logger) Warn(msg string)
- func (l *Logger) Warnf(format string, v ...interface{})
- func (l *Logger) WithStr(key, value string) Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLogger = &Logger{zerolog.New(os.Stderr).With().CallerWithSkipFrameCount(3).Logger(), context.Background()}
Functions ¶
This section is empty.
Types ¶
type LogOption ¶ added in v0.1.1
type LogOption func(o *Logger)
func WithFileLog ¶ added in v0.1.1
WithFileLog is print log to file filename log's file path maxSize 在进行切割之前,日志文件的最大大小(以MB为单位) maxBackups 保留旧文件的最大个数 maxAge:保留旧文件的最大天数 compress:是否压缩/归档旧文件
func WithLogLevel ¶ added in v0.1.1
type Logger ¶
func NewContextLogger ¶ added in v0.1.1
Click to show internal directories.
Click to hide internal directories.