Documentation ¶
Index ¶
- Constants
- func InitLogging()
- type Configuration
- type Fields
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Panic(v ...interface{})
- func (l *Logger) Panicf(format string, args ...interface{})
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) Printf(format string, args ...interface{})
- func (l *Logger) UnSugar()
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) WithContext(ctx context.Context)
- func (l *Logger) WithFields(fields Fields)
Constants ¶
View Source
const ( RequestIDKey string = "requestID" SessionIDKey string = "sessionID" )
View Source
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 InitLogging ¶
func InitLogging()
Types ¶
type Configuration ¶
type Configuration struct { DevEnv bool EnableConsole bool ConsoleJSONFormat bool ConsoleLevel string EnableFile bool FileJSONFormat bool FileLevel string FileLocation string }
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 struct {
// contains filtered or unexported fields
}
func (*Logger) WithContext ¶
func (*Logger) WithFields ¶
Click to show internal directories.
Click to hide internal directories.