Documentation ¶
Index ¶
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func SetColor(color bool)
- func SetLevel(level Level)
- func SetLevelByString(level string)
- func SetOutputFile(f string)
- func SetRolling(on bool)
- func ToContext(ctx context.Context, log *Logger) context.Context
- func Warning(v ...interface{})
- func Warningf(format string, v ...interface{})
- type Level
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) SetColor(on bool) *Logger
- func (l *Logger) SetLevel(level Level) *Logger
- func (l *Logger) SetLevelByString(level string) *Logger
- func (l *Logger) SetOutputFile(path string) *Logger
- func (l *Logger) SetRolling(on bool) *Logger
- func (l *Logger) Warning(v ...interface{})
- func (l *Logger) Warningf(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger 日志对象.
func FromContext ¶ added in v1.13.0
FromContext 从ctx中查找日志对象,找不到返回nil
func FromContextOrDefault ¶ added in v1.13.0
FromContextOrDefault 从ctx中查找日志对象,找不到返回默认log对象
func (*Logger) SetLevelByString ¶
SetLevelByString 设置字符串格式的日志级别.
func (*Logger) SetOutputFile ¶
SetOutputFile 初始化时设置输出文件.
Click to show internal directories.
Click to hide internal directories.