Documentation ¶
Index ¶
- Constants
- func Debugf(format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func NewLogger(config Configuration, loggerInstance int) error
- func Panicf(format string, args ...interface{})
- func Warnf(format string, args ...interface{})
- type Configuration
- type Fields
- type Logger
Constants ¶
View Source
const ( //Debug has verbose message Debug = "debug" //Info is default informer 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" )
View Source
const ( //InstanceZapLogger will be used to create Zap instance for the logger InstanceZapLogger int = iota )
Variables ¶
This section is empty.
Functions ¶
func NewLogger ¶
func NewLogger(config Configuration, loggerInstance int) error
NewLogger returns an instance of Logger
Types ¶
type Configuration ¶
type Configuration struct { EnableConsole bool `default:"true"` ConsoleJSONFormat bool `default:"false"` ConsoleLevel string `default:"informer.Debug"` EnableFile bool `default:"true"` FileJSONFormat bool `default:"true"` FileLevel string `default:"informer.Debug"` FileLocation string `default:"log.log"` }
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 Fields ¶
type Fields map[string]interface{}
Fields Type to pass when we want to call WithFields for structured logging
type Logger ¶
type Logger interface { Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) Panicf(format string, args ...interface{}) WithFields(keyValues Fields) Logger }
Logger is our contract for the logger
func WithFields ¶
Click to show internal directories.
Click to hide internal directories.