Documentation
¶
Index ¶
- func Debug(message string, kv ...interface{}) (int, error)
- func Error(message string, kv ...interface{}) (int, error)
- func Fatal(message string, kv ...interface{}) (int, error)
- func FormatterJSON(l *Logger, level string, message string, kv ...interface{}) string
- func FormatterKV(l *Logger, level string, message string, kv ...interface{}) string
- func FormatterSimple(l *Logger, level string, message string, kv ...interface{}) string
- func Info(message string, kv ...interface{}) (int, error)
- func Notice(message string, kv ...interface{}) (int, error)
- func OptionDisableLevel(levelOff bool) func(l *Logger)
- func OptionDisableMutex(mutexOff bool) func(*Logger)
- func OptionDisableTime(timeOff bool) func(l *Logger)
- func OptionEnableDebug(debugOn bool) func(*Logger)
- func OptionEnableLocalTime(localTimeOn bool) func(*Logger)
- func OptionEnableTrace(traceOn bool) func(*Logger)
- func OptionWithLevelKey(key string) func(l *Logger)
- func OptionWithMessageKey(key string) func(l *Logger)
- func OptionWithStaticKV(key string, value interface{}) func(*Logger)
- func OptionWithTimeFormat(format string) func(*Logger)
- func OptionWithTimeKey(key string) func(l *Logger)
- func OptionWithWriter(w io.Writer) func(l *Logger)
- func SetLogger(l *Logger)
- func Trace(message string, kv ...interface{}) (int, error)
- func Warning(message string, kv ...interface{}) (int, error)
- type Formatter
- type Logger
- func (l *Logger) Debug(message string, kv ...interface{}) (int, error)
- func (l *Logger) Error(message string, kv ...interface{}) (int, error)
- func (l *Logger) Fatal(message string, kv ...interface{}) (int, error)
- func (l *Logger) Info(message string, kv ...interface{}) (int, error)
- func (l *Logger) Notice(message string, kv ...interface{}) (int, error)
- func (l *Logger) Print(message string, kv ...interface{}) (int, error)
- func (l *Logger) Trace(message string, kv ...interface{}) (int, error)
- func (l *Logger) Warning(message string, kv ...interface{}) (int, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatterJSON ¶
FormatterJSON formats every log line as JSON format
func FormatterKV ¶
FormatterKV formats every log line with key: "value" format using strconv.Quote(...)
func FormatterSimple ¶
FormatterSimple formats every log line in a simple format %timestamp% [%level%] %message% %key-values%
func OptionDisableLevel ¶
OptionDisableLevel removes level from log lines
func OptionDisableMutex ¶
OptionDisableMutex disables mutex protection of writer
func OptionDisableTime ¶
OptionDisableTime removes time from log lines
func OptionEnableDebug ¶
OptionEnableDebug enables/disables debug mode
func OptionEnableLocalTime ¶
OptionEnableLocalTime enables/disables local time instead of utc time
func OptionEnableTrace ¶
OptionEnableTrace enables/disables trace mode
func OptionWithLevelKey ¶
OptionWithLevelKey overwrites the key that is used for level
func OptionWithMessageKey ¶
OptionWithMessageKey overwrites the key that is used for message
func OptionWithStaticKV ¶
OptionWithStaticKV adds a key value pair to each upcoming log line .. This option can be passed multiple times.
func OptionWithTimeFormat ¶
OptionWithTimeFormat changes the time format
func OptionWithTimeKey ¶
OptionWithTimeKey overwrites the key that is used for time
func OptionWithWriter ¶
OptionWithWriter overwrites the writer of the logger
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger holds all logger configurations