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
- type ZeroLogger
- func (z *ZeroLogger) Debug(args ...interface{})
- func (z *ZeroLogger) Debugf(format string, args ...interface{})
- func (z *ZeroLogger) Error(args ...interface{})
- func (z *ZeroLogger) Errorf(format string, args ...interface{})
- func (z *ZeroLogger) Fatal(args ...interface{})
- func (z *ZeroLogger) Fatalf(format string, args ...interface{})
- func (z *ZeroLogger) Fields() Fields
- func (z *ZeroLogger) Info(args ...interface{})
- func (z *ZeroLogger) Infof(format string, args ...interface{})
- func (z *ZeroLogger) Panic(args ...interface{})
- func (z *ZeroLogger) Panicf(format string, args ...interface{})
- func (z *ZeroLogger) Prefix() string
- func (z *ZeroLogger) Print(args ...interface{})
- func (z *ZeroLogger) Printf(format string, args ...interface{})
- func (*ZeroLogger) SetLevel(level Level)
- func (z *ZeroLogger) Trace(args ...interface{})
- func (z *ZeroLogger) Tracef(format string, args ...interface{})
- func (z *ZeroLogger) Warn(args ...interface{})
- func (z *ZeroLogger) Warnf(format string, args ...interface{})
- func (z *ZeroLogger) WithFields(fields Fields) Logger
- func (z *ZeroLogger) 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
type ZeroLogger ¶
type ZeroLogger struct {
// contains filtered or unexported fields
}
func NewDefaultZeroLogger ¶
func NewDefaultZeroLogger() *ZeroLogger
func NewZeroLogger ¶
func NewZeroLogger(logger zerolog.Logger, prefix string, fields Fields) *ZeroLogger
func (*ZeroLogger) Debug ¶
func (z *ZeroLogger) Debug(args ...interface{})
func (*ZeroLogger) Debugf ¶
func (z *ZeroLogger) Debugf(format string, args ...interface{})
func (*ZeroLogger) Error ¶
func (z *ZeroLogger) Error(args ...interface{})
func (*ZeroLogger) Errorf ¶
func (z *ZeroLogger) Errorf(format string, args ...interface{})
func (*ZeroLogger) Fatal ¶
func (z *ZeroLogger) Fatal(args ...interface{})
func (*ZeroLogger) Fatalf ¶
func (z *ZeroLogger) Fatalf(format string, args ...interface{})
func (*ZeroLogger) Fields ¶
func (z *ZeroLogger) Fields() Fields
func (*ZeroLogger) Info ¶
func (z *ZeroLogger) Info(args ...interface{})
func (*ZeroLogger) Infof ¶
func (z *ZeroLogger) Infof(format string, args ...interface{})
func (*ZeroLogger) Panic ¶
func (z *ZeroLogger) Panic(args ...interface{})
func (*ZeroLogger) Panicf ¶
func (z *ZeroLogger) Panicf(format string, args ...interface{})
func (*ZeroLogger) Prefix ¶
func (z *ZeroLogger) Prefix() string
func (*ZeroLogger) Print ¶
func (z *ZeroLogger) Print(args ...interface{})
func (*ZeroLogger) Printf ¶
func (z *ZeroLogger) Printf(format string, args ...interface{})
func (*ZeroLogger) SetLevel ¶
func (*ZeroLogger) SetLevel(level Level)
func (*ZeroLogger) Trace ¶
func (z *ZeroLogger) Trace(args ...interface{})
func (*ZeroLogger) Tracef ¶
func (z *ZeroLogger) Tracef(format string, args ...interface{})
func (*ZeroLogger) Warn ¶
func (z *ZeroLogger) Warn(args ...interface{})
func (*ZeroLogger) Warnf ¶
func (z *ZeroLogger) Warnf(format string, args ...interface{})
func (*ZeroLogger) WithFields ¶
func (z *ZeroLogger) WithFields(fields Fields) Logger
func (*ZeroLogger) WithPrefix ¶
func (z *ZeroLogger) WithPrefix(prefix string) Logger
Click to show internal directories.
Click to hide internal directories.