Documentation ¶
Index ¶
- type Logger
- type StructuredLogger
- func (l StructuredLogger) Debug(msg string, fields ...interface{})
- func (l StructuredLogger) Error(msg string, fields ...interface{})
- func (l StructuredLogger) Info(msg string, fields ...interface{})
- func (l StructuredLogger) LogJSON(value bool) StructuredLogger
- func (l StructuredLogger) SetDefaultFields(defaultFields map[string]string) StructuredLogger
- func (l StructuredLogger) SetLogLevel(logLevel string) StructuredLogger
- func (l StructuredLogger) Warn(msg string, fields ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { Error(string, ...interface{}) Info(string, ...interface{}) Debug(string, ...interface{}) Warn(string, ...interface{}) }
Logger interface implements a simple logger.
type StructuredLogger ¶
type StructuredLogger struct {
// contains filtered or unexported fields
}
StructuredLogger is a logger based on logrus.
func NewStructuredLogger ¶
func NewStructuredLogger() StructuredLogger
NewStructuredLogger creates a new structured logger.
func (StructuredLogger) Debug ¶
func (l StructuredLogger) Debug(msg string, fields ...interface{})
Debug logs a debug message.
func (StructuredLogger) Error ¶
func (l StructuredLogger) Error(msg string, fields ...interface{})
Error logs an error message.
func (StructuredLogger) Info ¶
func (l StructuredLogger) Info(msg string, fields ...interface{})
Info logs an info message.
func (StructuredLogger) LogJSON ¶
func (l StructuredLogger) LogJSON(value bool) StructuredLogger
LogJSON determines whether or not to format the logs as JSON.
func (StructuredLogger) SetDefaultFields ¶
func (l StructuredLogger) SetDefaultFields(defaultFields map[string]string) StructuredLogger
SetDefaultFields sets fields to be logged on every use of the logger.
func (StructuredLogger) SetLogLevel ¶
func (l StructuredLogger) SetLogLevel(logLevel string) StructuredLogger
SetLogLevel allows the log level to be set.
func (StructuredLogger) Warn ¶
func (l StructuredLogger) Warn(msg string, fields ...interface{})
Warn logs an warning message.
Click to show internal directories.
Click to hide internal directories.