Documentation ¶
Overview ¶
package logger is a minimal logger weapper
Index ¶
- Constants
- Variables
- func Debugf(format string, v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Infof(format string, v ...interface{})
- func Log(format string, v ...interface{})
- func Panicf(format string, v ...interface{})
- func Printf(format string, v ...interface{})
- func SetLevel(lvl Level)
- func Tracef(format string, v ...interface{})
- func Warnf(format string, v ...interface{})
- type Level
- type Logger
Constants ¶
View Source
const LogValid bool = false //nolint:gochecknoglobals //i know that
Variables ¶
View Source
var AllLevels = []Level{ PanicLevel, FatalLevel, ErrorLevel, WarnLevel, InfoLevel, DebugLevel, TraceLevel, OffLevel, }
AllLevels is a constant exposing all logging levels
Functions ¶
Types ¶
type Level ¶
type Level uint32
Level type
const ( // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... PanicLevel Level = iota // FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the // logging level is set to Panic. FatalLevel // ErrorLevel level. Logs. Used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel // InfoLevel level. General operational entries about what's going on inside the // application. InfoLevel // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel // TraceLevel level. Designates finer-grained informational events than the Debug. TraceLevel // OffLevel level. The logger will be shutdown. OffLevel )
These are the different logging levels. You can set the logging level to log on your instance of logger, obtained with `logrus.New()`.
func ParseLevel ¶
ParseLevel takes a string level and returns the Logrus log level constant.
func (Level) MarshalText ¶
MarshalText convert Level to string and []byte
func (*Level) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Logger ¶
type Logger interface { Printf(format string, v ...interface{}) Infof(format string, v ...interface{}) Warnf(format string, v ...interface{}) Debugf(format string, v ...interface{}) Tracef(format string, v ...interface{}) Errorf(format string, v ...interface{}) Fatalf(format string, v ...interface{}) Panicf(format string, v ...interface{}) SetLevel(lvl Level) GetLevel() Level }
Click to show internal directories.
Click to hide internal directories.