Documentation
¶
Index ¶
- Constants
- func Close()
- func Debug(a ...any)
- func Debugf(format string, a ...any)
- func Error(a ...any)
- func Errorf(format string, a ...any)
- func Fatal(a ...any)
- func Fatalf(format string, a ...any)
- func Info(a ...any)
- func Infof(format string, a ...any)
- func NewLogger(opts ...Option) *defaultLogger
- func Panic(a ...any)
- func Panicf(format string, a ...any)
- func Print(level Level, a ...any)
- func Printf(level Level, format string, a ...any)
- func SetLogger(logger Logger)
- func Warn(a ...any)
- func Warnf(format string, a ...any)
- type Entity
- type Level
- type Logger
- type Option
- func WithCallFullPath(fullPath bool) Option
- func WithCallSkip(skip int) Option
- func WithLevel(level Level) Option
- func WithStackLevel(level Level) Option
- func WithSyncers(syncers ...Syncer) Option
- func WithTerminals[T Terminal | []Terminal | map[Terminal][]Level](terminals ...T) Option
- func WithTimeFormat(timeFormat string) Option
- type Syncer
- type Terminal
Constants ¶
View Source
const ( LevelNone = internal.LevelNone LevelDebug = internal.LevelDebug LevelInfo = internal.LevelInfo LevelWarn = internal.LevelWarn LevelError = internal.LevelError LevelFatal = internal.LevelFatal LevelPanic = internal.LevelPanic )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
// Print 打印日志,不含堆栈信息
Print(level Level, a ...any)
// Printf 打印模板日志,不含堆栈信息
Printf(level Level, format string, a ...any)
// Debug 打印调试日志
Debug(a ...any)
// Debugf 打印调试模板日志
Debugf(format string, a ...any)
// Info 打印信息日志
Info(a ...any)
// Infof 打印信息模板日志
Infof(format string, a ...any)
// Warn 打印警告日志
Warn(a ...any)
// Warnf 打印警告模板日志
Warnf(format string, a ...any)
// Error 打印错误日志
Error(a ...any)
// Errorf 打印错误模板日志
Errorf(format string, a ...any)
// Fatal 打印致命错误日志
Fatal(a ...any)
// Fatalf 打印致命错误模板日志
Fatalf(format string, a ...any)
// Panic 打印Panic日志
Panic(a ...any)
// Panicf 打印Panic模板日志
Panicf(format string, a ...any)
// Close 关闭日志
Close() error
}
type Option ¶
type Option func(o *options)
func WithCallFullPath ¶
WithCallFullPath 设置日志的输出栈的调用文件全路径
func WithTerminals ¶
WithTerminals 设置日志的输出终端
Click to show internal directories.
Click to hide internal directories.