Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextField ¶
type ContextField struct { Key string Val interface{} }
ContextField is a name/value pair within the context fields.
type JSON ¶
type JSON struct { // DisableTimestamp disables output of timestamp field. DisableTimestamp bool // DisableLevel disables output of level field. DisableLevel bool // DisableMsg disables output of msg field. DisableMsg bool // DisableContext disables output of all context fields. DisableContext bool // DisableStacktrace disables output of stack trace. DisableStacktrace bool // TimestampFormat is an optional format for timestamps. If empty // then DefTimestampFormat is used. TimestampFormat string // Deprecated: this has no effect. Indent string // EscapeHTML determines if certain characters (e.g. `<`, `>`, `&`) // are escaped. EscapeHTML bool // KeyTimestamp overrides the timestamp field key name. KeyTimestamp string // KeyLevel overrides the level field key name. KeyLevel string // KeyMsg overrides the msg field key name. KeyMsg string // KeyContextFields when not empty will group all context fields // under this key. KeyContextFields string // KeyStacktrace overrides the stacktrace field key name. KeyStacktrace string // ContextSorter allows custom sorting for the context fields. ContextSorter func(fields logr.Fields) []ContextField // contains filtered or unexported fields }
JSON formats log records as JSON.
type JSONLogRec ¶
JSONLogRec decorates a LogRec adding JSON encoding.
func (JSONLogRec) IsNil ¶
func (rec JSONLogRec) IsNil() bool
IsNil returns true if the LogRec pointer is nil.
func (JSONLogRec) MarshalJSONObject ¶
func (rec JSONLogRec) MarshalJSONObject(enc *gojay.Encoder)
MarshalJSONObject encodes the LogRec as JSON.
type Plain ¶
type Plain struct { // DisableTimestamp disables output of timestamp field. DisableTimestamp bool // DisableLevel disables output of level field. DisableLevel bool // DisableMsg disables output of msg field. DisableMsg bool // DisableContext disables output of all context fields. DisableContext bool // DisableStacktrace disables output of stack trace. DisableStacktrace bool // Delim is an optional delimiter output between each log field. // Defaults to a single space. Delim string // TimestampFormat is an optional format for timestamps. If empty // then DefTimestampFormat is used. TimestampFormat string }
Plain is the simplest formatter, outputting only text with no colors.
Click to show internal directories.
Click to hide internal directories.