Documentation ¶
Overview ¶
Package logger defines a simple logger API with level of logging control.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { // (Re)xpose base Output for logging events. Output(calldept int, s string) error // Errorf logs an error. Errorf(format string, v ...interface{}) // Fatalf logs an error and exists the program with os.Exit(1). Fatalf(format string, v ...interface{}) // PanicStackf logs a error message and a stacktrace, for use // in panic recovery. PanicStackf(format string, v ...interface{}) // Infof logs a info message. Infof(format string, v ...interface{}) // Debugf logs a debug message. Debugf(format string, v ...interface{}) }
Logger is a simple logger interface with logging at levels.
func NewSimpleLogger ¶
NewSimpleLogger creates a logger logging only up to the given level. level can be in order: "error", "info", "debug". It takes a io.Writer.
func NewSimpleLoggerFromMinimalLogger ¶
func NewSimpleLoggerFromMinimalLogger(minLog MinimalLogger, level string) Logger
NewSimpleLoggerFromMinimalLogger creates a logger logging only up to the given level. level can be in order: "error", "info", "debug". It takes a value just implementing stlib Logger.Output().
type MinimalLogger ¶
MinimalLogger is the minimal interface required to build a simple logger on top.
Click to show internal directories.
Click to hide internal directories.