Documentation ¶
Index ¶
- type Fields
- type Level
- type Loggable
- type Logger
- type LogrusLogger
- func (l *LogrusLogger) Debug(args ...interface{})
- func (l *LogrusLogger) Debugf(format string, args ...interface{})
- func (l *LogrusLogger) Error(args ...interface{})
- func (l *LogrusLogger) Errorf(format string, args ...interface{})
- func (l *LogrusLogger) Fatal(args ...interface{})
- func (l *LogrusLogger) Fatalf(format string, args ...interface{})
- func (l *LogrusLogger) Fields() Fields
- func (l *LogrusLogger) Info(args ...interface{})
- func (l *LogrusLogger) Infof(format string, args ...interface{})
- func (l *LogrusLogger) Panic(args ...interface{})
- func (l *LogrusLogger) Panicf(format string, args ...interface{})
- func (l *LogrusLogger) Prefix() string
- func (l *LogrusLogger) Print(args ...interface{})
- func (l *LogrusLogger) Printf(format string, args ...interface{})
- func (l *LogrusLogger) SetLevel(level Level)
- func (l *LogrusLogger) Trace(args ...interface{})
- func (l *LogrusLogger) Tracef(format string, args ...interface{})
- func (l *LogrusLogger) Warn(args ...interface{})
- func (l *LogrusLogger) Warnf(format string, args ...interface{})
- func (l *LogrusLogger) WithFields(fields Fields) Logger
- func (l *LogrusLogger) WithPrefix(prefix string) Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 )
These are the different logging levels. You can set the logging level to log on your instance of logger, obtained with `logrus.New()`.
type Logger ¶
type Logger interface { Print(args ...interface{}) Printf(format string, args ...interface{}) Trace(args ...interface{}) Tracef(format string, args ...interface{}) Debug(args ...interface{}) Debugf(format string, args ...interface{}) Info(args ...interface{}) Infof(format string, args ...interface{}) Warn(args ...interface{}) Warnf(format string, args ...interface{}) Error(args ...interface{}) Errorf(format string, args ...interface{}) Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) Panic(args ...interface{}) Panicf(format string, args ...interface{}) WithPrefix(prefix string) Logger Prefix() string WithFields(fields Fields) Logger Fields() Fields SetLevel(level Level) }
Logger interface used as base logger throughout the library.
func AddFieldsFrom ¶
type LogrusLogger ¶
type LogrusLogger struct {
// contains filtered or unexported fields
}
func NewDefaultLogrusLogger ¶
func NewDefaultLogrusLogger() *LogrusLogger
func NewLogrusLogger ¶
func NewLogrusLogger(logrus logrus.Ext1FieldLogger, prefix string, fields Fields) *LogrusLogger
func (*LogrusLogger) Debug ¶
func (l *LogrusLogger) Debug(args ...interface{})
func (*LogrusLogger) Debugf ¶
func (l *LogrusLogger) Debugf(format string, args ...interface{})
func (*LogrusLogger) Error ¶
func (l *LogrusLogger) Error(args ...interface{})
func (*LogrusLogger) Errorf ¶
func (l *LogrusLogger) Errorf(format string, args ...interface{})
func (*LogrusLogger) Fatal ¶
func (l *LogrusLogger) Fatal(args ...interface{})
func (*LogrusLogger) Fatalf ¶
func (l *LogrusLogger) Fatalf(format string, args ...interface{})
func (*LogrusLogger) Fields ¶
func (l *LogrusLogger) Fields() Fields
func (*LogrusLogger) Info ¶
func (l *LogrusLogger) Info(args ...interface{})
func (*LogrusLogger) Infof ¶
func (l *LogrusLogger) Infof(format string, args ...interface{})
func (*LogrusLogger) Panic ¶
func (l *LogrusLogger) Panic(args ...interface{})
func (*LogrusLogger) Panicf ¶
func (l *LogrusLogger) Panicf(format string, args ...interface{})
func (*LogrusLogger) Prefix ¶
func (l *LogrusLogger) Prefix() string
func (*LogrusLogger) Print ¶
func (l *LogrusLogger) Print(args ...interface{})
func (*LogrusLogger) Printf ¶
func (l *LogrusLogger) Printf(format string, args ...interface{})
func (*LogrusLogger) SetLevel ¶
func (l *LogrusLogger) SetLevel(level Level)
func (*LogrusLogger) Trace ¶
func (l *LogrusLogger) Trace(args ...interface{})
func (*LogrusLogger) Tracef ¶
func (l *LogrusLogger) Tracef(format string, args ...interface{})
func (*LogrusLogger) Warn ¶
func (l *LogrusLogger) Warn(args ...interface{})
func (*LogrusLogger) Warnf ¶
func (l *LogrusLogger) Warnf(format string, args ...interface{})
func (*LogrusLogger) WithFields ¶
func (l *LogrusLogger) WithFields(fields Fields) Logger
func (*LogrusLogger) WithPrefix ¶
func (l *LogrusLogger) WithPrefix(prefix string) Logger
Click to show internal directories.
Click to hide internal directories.