Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = &Options{
Backend: "simple",
}
DefaultOptions common default options
Functions ¶
func RegisterBackend ¶
func RegisterBackend(name string, factory backendFactory)
Types ¶
type Logger ¶
type Logger interface { // ErrorErr simply logs an error (inclduing stack if created vis pkg/errors) ErrorErr(error) // Errorf logs a formated error message Errorf(format string, args ...interface{}) // Error logs an error message Error(args ...interface{}) // Warnf logs a formatted warning message Warnf(format string, args ...interface{}) // Warn logs a warning message Warn(args ...interface{}) // Infof logs a formatted info message Infof(format string, args ...interface{}) // Info logs an info message Info(args ...interface{}) // Debugf logs a formatted debug message Debugf(format string, args ...interface{}) // Debug logs a debug message Debug(args ...interface{}) // Create a child logger with fields (this field will be added to the fields // of the current logger) WithContext(fields map[string]interface{}) Logger // Create a child logger with an additional field WithField(name, value string) Logger }
Logger is a generic logger interface to the different logger implementations
func NewSimpleLogger ¶
NewSimpleLogger creates a simple Logger based on the golang log package
func NewSimpleLoggerNull ¶
NewSimpleLoggerNull create a simple Logger discarding all log entries (i.e. /dev/null). Useful for testing where you do not want to polute testing output with log messages.
type SimpleStackTracer ¶
type SimpleStackTracer interface {
ErrorStack() string
}
Click to show internal directories.
Click to hide internal directories.