Documentation ¶
Overview ¶
Package formatter implements a formatter compatible with the logrus logger library
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
FieldMatchColorScheme map[string][]*FieldMatch
)
nolint: gochecknoglobals
Functions ¶
func AddFieldMatchColorScheme ¶
func AddFieldMatchColorScheme(key string, match *FieldMatch)
AddFieldMatchColorScheme registers field match color scheme
Types ¶
type ColorSchema ¶
type ColorSchema struct { Timestamp string InfoLevel string WarnLevel string ErrorLevel string FatalLevel string PanicLevel string DebugLevel string }
ColorSchema is the color schema for the default log parts/levels
type FieldMatch ¶
type FieldMatch struct { Value interface{} Color string }
FieldMatch contains the value and defined color of the field match
type Formatter ¶
type Formatter struct { // timestamp formatting, default is time.RFC3339 TimestampFormat string // color schema for messages ColorSchema *ColorSchema // no colors DisableColors bool // no check for TTY terminal ForceColors bool // no timestamp DisableTimestamp bool // false -> time passed, true -> timestamp UseTimePassedAsTimestamp bool // false -> info, true -> INFO UseUppercaseLevel bool // reserves space for all log entries for all registered matches PadAllLogEntries bool }
Formatter contains all options for this formatter
Click to show internal directories.
Click to hide internal directories.