Documentation
¶
Index ¶
- Constants
- func Debug(args ...any)
- func Debugf(template string, args ...any)
- func Error(args ...any)
- func Errorf(template string, args ...any)
- func Info(args ...any)
- func Infof(template string, args ...any)
- func SetLogger(logger Logger)
- func SetLoggerCallerDisable() error
- func SetLoggerLevel(level LoggerLevel) error
- func Warn(args ...any)
- func Warnf(template string, args ...any)
- type Logger
- type LoggerLevel
Constants ¶
View Source
const ( // LoggerLevelDebug DebugLevel logs are typically voluminous, and are usually disabled in // production. LoggerLevelDebug = LoggerLevel(zapcore.DebugLevel) // LoggerLevelInfo InfoLevel is the default logging priority. LoggerLevelInfo = LoggerLevel(zapcore.InfoLevel) // LoggerLevelWarn WarnLevel logs are more important than Infof, but don't need individual // human review. LoggerLevelWarn = LoggerLevel(zapcore.WarnLevel) // LoggerLevelError ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. LoggerLevelError = LoggerLevel(zapcore.ErrorLevel) // LoggerLevelDPanic DPanicLevel logs are particularly important errors. In development the // logger panics after writing the message. LoggerLevelDPanic = LoggerLevel(zapcore.DPanicLevel) // LoggerLevelPanic PanicLevel logs a message, then panics. LoggerLevelPanic = LoggerLevel(zapcore.PanicLevel) // LoggerLevelFatal FatalLevel logs a message, then calls os.Exit(1). LoggerLevelFatal = LoggerLevel(zapcore.FatalLevel) )
Variables ¶
This section is empty.
Functions ¶
func SetLoggerCallerDisable ¶
func SetLoggerCallerDisable() error
SetLoggerCallerDisable disable caller info in production env for performance improve. It is highly recommended that you execute this method in a production environment.
Types ¶
type Logger ¶
type Logger interface {
Info(args ...any)
Warn(args ...any)
Error(args ...any)
Debug(args ...any)
Infof(fmt string, args ...any)
Warnf(fmt string, args ...any)
Errorf(fmt string, args ...any)
Debugf(fmt string, args ...any)
}
Logger for user who want to customize logger of getty
type LoggerLevel ¶
type LoggerLevel int8
Click to show internal directories.
Click to hide internal directories.