Documentation ¶
Index ¶
- type Logger
- type LogrusLogger
- func (l *LogrusLogger) Debug(message string, values ...interface{})
- func (l *LogrusLogger) Error(message string, values ...interface{})
- func (l *LogrusLogger) Fatal(message string, values ...interface{})
- func (l *LogrusLogger) Info(message string, values ...interface{})
- func (l *LogrusLogger) Init()
- func (l *LogrusLogger) Trace(message string, values ...interface{})
- func (l *LogrusLogger) Warn(message string, values ...interface{})
- type NoopLogger
- func (l *NoopLogger) Debug(message string, values ...interface{})
- func (l *NoopLogger) Error(message string, values ...interface{})
- func (l *NoopLogger) Fatal(message string, values ...interface{})
- func (l *NoopLogger) Info(message string, values ...interface{})
- func (l *NoopLogger) Init()
- func (l *NoopLogger) Trace(message string, values ...interface{})
- func (l *NoopLogger) Warn(message string, values ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { Init() Trace(string, ...interface{}) Debug(string, ...interface{}) Info(string, ...interface{}) Warn(string, ...interface{}) Error(string, ...interface{}) Fatal(string, ...interface{}) }
The Logger interface is an abstraction for logging from quacktors. By default, a logrus implementation is included but another logger like zap or zerolog can easily be implemented.
type LogrusLogger ¶
The LogrusLogger is the default logger for quacktors. As the name implies, it uses logrus under the hood.
func (*LogrusLogger) Debug ¶
func (l *LogrusLogger) Debug(message string, values ...interface{})
Debug adds a logrus log entry on the corresponding log level
func (*LogrusLogger) Error ¶
func (l *LogrusLogger) Error(message string, values ...interface{})
Error adds a logrus log entry on the corresponding log level
func (*LogrusLogger) Fatal ¶
func (l *LogrusLogger) Fatal(message string, values ...interface{})
Fatal adds a logrus log entry on the corresponding log level and quits the application with exit-code 1
func (*LogrusLogger) Info ¶
func (l *LogrusLogger) Info(message string, values ...interface{})
Info adds a logrus log entry on the corresponding log level
func (*LogrusLogger) Init ¶
func (l *LogrusLogger) Init()
Init initializes the LogrusLogger with the default config (ForceColors=true, LogLevel=Trace)
func (*LogrusLogger) Trace ¶
func (l *LogrusLogger) Trace(message string, values ...interface{})
Trace adds a logrus log entry on the corresponding log level
func (*LogrusLogger) Warn ¶
func (l *LogrusLogger) Warn(message string, values ...interface{})
Warn adds a logrus log entry on the corresponding log level
type NoopLogger ¶
type NoopLogger struct { }
The NoopLogger is an empty implementation of Logger. This can be used to disable the logging capabilities of quacktors.
func (*NoopLogger) Debug ¶
func (l *NoopLogger) Debug(message string, values ...interface{})
Debug noop implementation
func (*NoopLogger) Error ¶
func (l *NoopLogger) Error(message string, values ...interface{})
Error noop implementation
func (*NoopLogger) Fatal ¶
func (l *NoopLogger) Fatal(message string, values ...interface{})
Fatal does not print (as this is a noop implementation), but does exit the application with exit code 1, as this is a "Fatal" method.
func (*NoopLogger) Info ¶
func (l *NoopLogger) Info(message string, values ...interface{})
Info noop implementation
func (*NoopLogger) Trace ¶
func (l *NoopLogger) Trace(message string, values ...interface{})
Trace noop implementation
func (*NoopLogger) Warn ¶
func (l *NoopLogger) Warn(message string, values ...interface{})
Warn noop implementation