Documentation ¶
Index ¶
- Constants
- func Debug(msg string)
- func Debugf(template string, args ...interface{})
- func Debugw(msg string, keysAndValues ...interface{})
- func Error(msg string)
- func Errorf(template string, args ...interface{})
- func Errorw(msg string, keysAndValues ...interface{})
- func Fatal(msg string)
- func Fatalf(template string, args ...interface{})
- func Fatalw(msg string, keysAndValues ...interface{})
- func Info(msg string)
- func Infof(template string, args ...interface{})
- func Infow(msg string, keysAndValues ...interface{})
- func NewLogger(config Configuration) error
- func Panic(msg string)
- func Panicf(template string, args ...interface{})
- func Panicw(msg string, keysAndValues ...interface{})
- func Warn(msg string)
- func Warnf(template string, args ...interface{})
- func Warnw(msg string, keysAndValues ...interface{})
- type BaseFields
- type Configuration
- type Logger
Constants ¶
const ( // DEBUG has verbose message DEBUG = "debug" // INFO is default log level INFO = "info" // WARN is for logging messages about possible issues WARN = "warn" // ERROR is for logging errors ERROR = "error" // FATAL is for logging fatal messages. The sytem shutsdown after logging the message. FATAL = "fatal" )
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf uses fmt.Sprintf to log a templated message.
func Debugw ¶
func Debugw(msg string, keysAndValues ...interface{})
Debugw logs a message with some additional context, With key and values, example: log.Debugw("message", "url", url, "attempt", 3) Keys in key-value pairs should be strings.
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf uses fmt.Sprintf to log a templated message.
func Errorw ¶
func Errorw(msg string, keysAndValues ...interface{})
Errorw logs a message with some additional context, With key and values, example: log.Errorw("message", "url", url, "attempt", 3) Keys in key-value pairs should be strings.
func Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf uses fmt.Sprintf to log a templated message.
func Fatalw ¶
func Fatalw(msg string, keysAndValues ...interface{})
Fatalw logs a message with some additional context, With key and values, example: log.Fatalw("message", "url", url, "attempt", 3) Keys in key-value pairs should be strings.
func Infof ¶
func Infof(template string, args ...interface{})
Infof uses fmt.Sprintf to log a templated message.
func Infow ¶
func Infow(msg string, keysAndValues ...interface{})
Infow logs a message with some additional context, With key and values, example: log.Infow("message", "url", url, "attempt", 3) Keys in key-value pairs should be strings.
func Panicf ¶
func Panicf(template string, args ...interface{})
Panicf uses fmt.Sprintf to log a templated message.
func Panicw ¶
func Panicw(msg string, keysAndValues ...interface{})
Panicw logs a message with some additional context, With key and values, example: log.Panicw("message", "url", url, "attempt", 3) Keys in key-value pairs should be strings.
Types ¶
type BaseFields ¶
BaseFields represents the base fields for create the basic fields of logger.
type Configuration ¶
type Configuration struct { IsJSON bool Level string BaseFields BaseFields }
Configuration stores the config for the logger For some loggers there can only be one level across writers, for such the level of Console is picked by default
type Logger ¶
type Logger interface { Debug(msg string) Debugw(msg string, keysAndValues ...interface{}) Debugf(template string, args ...interface{}) Info(msg string) Infow(msg string, keysAndValues ...interface{}) Infof(template string, args ...interface{}) Warn(msg string) Warnw(msg string, keysAndValues ...interface{}) Warnf(template string, args ...interface{}) Error(msg string) Errorw(msg string, keysAndValues ...interface{}) Errorf(template string, args ...interface{}) Fatal(msg string) Fatalw(msg string, keysAndValues ...interface{}) Fatalf(template string, args ...interface{}) Panic(msg string) Panicw(msg string, keysAndValues ...interface{}) Panicf(template string, args ...interface{}) }
Logger is our contract for the logger