Documentation ¶
Index ¶
Constants ¶
View Source
const ( FieldKeyMsg = "msg" FieldKeyLevel = "level" FieldKeyTime = "time" FieldValueLevel = "NONE" )
Default key names for the default fields
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONFormatter ¶
type JSONFormatter struct { // TimestampFormat sets the format used for marshaling timestamps. TimestampFormat string // DisableTimestamp allows disabling automatic timestamps in output DisableTimestamp bool // DataKey allows users to put all the log entry parameters into a nested dictionary at a given key. DataKey string // PrettyPrint will indent all json logs PrettyPrint bool }
JSONFormatter formats logs into parsable json
type TextFormatter ¶
type TextFormatter struct { // Set to true to bypass checking for a TTY before outputting colors. ForceColors bool // Force disabling colors. DisableColors bool // Disable timestamp logging. useful when output is redirected to logging // system that already adds timestamps. DisableTimestamp bool // TimestampFormat to use for display when a full timestamp is printed TimestampFormat string // Disables the truncation of the level text to 4 characters. DisableLevelTruncation bool // contains filtered or unexported fields }
TextFormatter formats logs into text
Click to show internal directories.
Click to hide internal directories.