Documentation ¶
Overview ¶
Package logger 日志
Index ¶
- type Fields
- type Level
- type Logger
- func (l *Logger) Debug(v ...any)
- func (l *Logger) Debugf(format string, v ...any)
- func (l *Logger) Error(v ...any)
- func (l *Logger) Errorf(format string, v ...any)
- func (l *Logger) Fatal(v ...any)
- func (l *Logger) Fatalf(format string, v ...any)
- func (l *Logger) Info(v ...any)
- func (l *Logger) Infof(format string, v ...any)
- func (l *Logger) JSONFormat(level Level, message string) map[string]any
- func (l *Logger) Output(level Level, message string)
- func (l *Logger) Panic(v ...any)
- func (l *Logger) Panicf(format string, v ...any)
- func (l *Logger) Warn(v ...any)
- func (l *Logger) Warnf(format string, v ...any)
- func (l *Logger) WithCaller(skip int) *Logger
- func (l *Logger) WithCallerFrames() *Logger
- func (l *Logger) WithContext(ctx context.Context) *Logger
- func (l *Logger) WithFields(f Fields) *Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger 日志结构体
func (*Logger) JSONFormat ¶
JSONFormat 将日志格式化为JSON
func (*Logger) WithCallerFrames ¶
WithCallerFrames 设置当前的整个调用栈信息
func (*Logger) WithContext ¶
WithContext 设置日志上下文字段
Click to show internal directories.
Click to hide internal directories.