Documentation ¶
Index ¶
- Constants
- func Debug(format string, args ...interface{})
- func Error(format string, args ...interface{})
- func Fatal(format string, args ...interface{})
- func Info(format string, args ...interface{})
- func Panic(format string, args ...interface{})
- func Warn(format string, args ...interface{})
- type Configuration
- type Fields
- type Logger
Constants ¶
View Source
const ( DebugLevel = "debug" InfoLevel = "info" WarnLevel = "warn" ErrorLevel = "error" FatalLevel = "fatal" InstanceZapLogger int = iota )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configuration ¶
type Configuration struct { EnableConsole bool ConsoleJSONFormat bool ConsoleLevel string EnableFile bool FileJSONFormat bool FileLevel string FileLocation string }
Configuration stores the config for the logger
type Logger ¶
type Logger interface { Debug(format string, args ...interface{}) Info(format string, args ...interface{}) Warn(format string, args ...interface{}) Error(format string, args ...interface{}) Fatal(format string, args ...interface{}) Panic(format string, args ...interface{}) WithContext(keyValues Fields) Logger }
Logger is our contract for the logger
func NewLogger ¶
func NewLogger(config Configuration) (Logger, error)
func NewZapLogger ¶
func NewZapLogger(config Configuration) (Logger, error)
func WithContext ¶
Click to show internal directories.
Click to hide internal directories.