Documentation
¶
Index ¶
- func ActiveLogLevel() logrus.Level
- func Debug(format string, args ...interface{})
- func Error(format string, args ...interface{})
- func Info(format string, args ...interface{})
- func InitLogger(logDir string, maxFiles int, logLevel int, noFileLog ...bool)
- func IsDebugEnabled(sink Sink) bool
- func Success(format string, args ...interface{})
- func WithContext(ctx context.Context, sink Sink) context.Context
- type CustomFormatter
- type Logger
- func (l *Logger) Debug(format string, args ...interface{})
- func (l *Logger) DebugEnabled() bool
- func (l *Logger) Error(format string, args ...interface{})
- func (l *Logger) Info(format string, args ...interface{})
- func (l *Logger) Success(format string, args ...interface{})
- func (l *Logger) Warn(format string, args ...interface{})
- type PlainFormatter
- type Sink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDebugEnabled ¶
IsDebugEnabled 允许热路径在构造日志参数前检查级别。自定义 Sink 未声明 级别接口时仍接收 Debug 调用,保持原有日志接入行为。
Types ¶
type CustomFormatter ¶
type CustomFormatter struct {
IsColored bool
}
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) DebugEnabled ¶
type PlainFormatter ¶
type PlainFormatter struct {
CustomFormatter
}
Click to show internal directories.
Click to hide internal directories.