Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(ctx context.Context, args ...any)
- func Debugf(ctx context.Context, format string, args ...any)
- func Debugln(ctx context.Context, args ...any)
- func Error(ctx context.Context, args ...any)
- func Errorf(ctx context.Context, format string, args ...any)
- func Errorln(ctx context.Context, args ...any)
- func Fatal(ctx context.Context, args ...any)
- func Fatalf(ctx context.Context, format string, args ...any)
- func Fatalln(ctx context.Context, args ...any)
- func Info(ctx context.Context, args ...any)
- func Infof(ctx context.Context, format string, args ...any)
- func Infoln(ctx context.Context, args ...any)
- func IsDebugLevel() bool
- func Panic(ctx context.Context, args ...any)
- func Panicf(ctx context.Context, format string, args ...any)
- func Panicln(ctx context.Context, args ...any)
- func Warn(ctx context.Context, args ...any)
- func Warnf(ctx context.Context, format string, args ...any)
- func Warnln(ctx context.Context, args ...any)
- type Level
- type TrLogger
- func (dl *TrLogger) Debug(ctx context.Context, args ...any)
- func (dl *TrLogger) Debugf(ctx context.Context, format string, args ...any)
- func (dl *TrLogger) Debugln(ctx context.Context, args ...any)
- func (dl *TrLogger) Error(ctx context.Context, args ...any)
- func (dl *TrLogger) Errorf(ctx context.Context, format string, args ...any)
- func (dl *TrLogger) Errorln(ctx context.Context, args ...any)
- func (dl *TrLogger) Fatal(ctx context.Context, args ...any)
- func (dl *TrLogger) Fatalf(ctx context.Context, format string, args ...any)
- func (dl *TrLogger) Fatalln(ctx context.Context, args ...any)
- func (dl *TrLogger) Info(ctx context.Context, args ...any)
- func (dl *TrLogger) Infof(ctx context.Context, format string, args ...any)
- func (dl *TrLogger) Infoln(ctx context.Context, args ...any)
- func (dl *TrLogger) Panic(ctx context.Context, args ...any)
- func (dl *TrLogger) Panicf(ctx context.Context, format string, args ...any)
- func (dl *TrLogger) Panicln(ctx context.Context, args ...any)
- func (dl *TrLogger) SetLevel(level string)
- func (dl *TrLogger) Warn(ctx context.Context, args ...any)
- func (dl *TrLogger) Warnf(ctx context.Context, format string, args ...any)
- func (dl *TrLogger) Warnln(ctx context.Context, args ...any)
Constants ¶
View Source
const ( // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... PanicLevel = "panic" // FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the // logging level is set to Panic. FatalLevel = "fatal" // ErrorLevel level. Logs. Used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel = "error" // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel = "warn" // InfoLevel level. General operational entries about what's going on inside the // application. InfoLevel = "info" // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel = "debug" // TraceLevel level. Designates finer-grained informational events than the Debug. TraceLevel = "trace" )
View Source
const ( // LevelDebug debug level LevelDebug = iota // LevelInfo info level LevelInfo // LevelWarn warn level LevelWarn // LevelError error level LevelError // LevelFatal fatal level LevelFatal )
View Source
const (
DefaultTimestampFormat = "2006-01-02 15:04:05.999999"
)
Variables ¶
View Source
var GlobalTrLogger = DefaultTrLogger()
Functions ¶
Types ¶
type Level ¶
type Level int8
Level type of log level
func LevelFromString ¶
LevelFromString convert string to Level if convert failed then return LevelInfo
Click to show internal directories.
Click to hide internal directories.