Documentation ¶
Index ¶
- Constants
- func Configure(logType string, logLevel string, production bool)
- func Debugf(format string, args ...interface{})
- func E(err error) bool
- func EL(l Logger, err error) bool
- func Errorf(format string, args ...interface{})
- func F(err error)
- func Fatalf(format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func Panicf(format string, args ...interface{})
- func ParseLevel(s string) int
- func Warnf(format string, args ...interface{})
- type Fields
- type Logger
- type LoggerConstructor
Constants ¶
const ( Panic = iota Fatal Error Warn Info Debug )
Log levels
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf logs a message with given format and arguments
func EL ¶
EL logs the error if it's not nil with given logger Return true if error is not nil FIXME: this prints file/line of the l.Errorf call not EL caller
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf logs a message with given format and arguments
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf logs a message with given format and arguments and then finishes the process with error exit code
func Infof ¶
func Infof(format string, args ...interface{})
Infof logs a message with given format and arguments
Types ¶
type Fields ¶
type Fields map[string]interface{}
Fields is a map of key/value pairs which can be attached to a logger This fields will be printed with every message of the logger
type Logger ¶
type Logger interface { // Log at debug level with fmt.Printf-like formatting Debugf(format string, args ...interface{}) // Log at info level with fmt.Printf-like formatting Infof(format string, args ...interface{}) // Log at warning level with fmt.Printf-like formatting Warnf(format string, args ...interface{}) // Log at error level with fmt.Printf-like formatting Errorf(format string, args ...interface{}) // Log at fatal level with fmt.Printf-like formatting, then terminate process (irrecoverable) Fatalf(format string, args ...interface{}) // Log at panic level with fmt.Printf-like formatting, then panic (recoverable) Panicf(format string, args ...interface{}) // Return a logger with the specified key-value pairs set, to be included in a subsequent normal logging call WithFields(keyValues Fields) Logger }
Logger is our contract for the logger
func WithFields ¶
WithFields attaches given key/value fields and return new logger with those fields attached