Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ContextFieldDefault = "core"
View Source
var ContextFieldName = "ctx"
View Source
var ModeFieldName = "mode"
Functions ¶
Types ¶
type CodecometWriter ¶
type CodecometWriter struct { // Out is the output destination. Out io.Writer // NoColor disables the colorized output. NoColor bool // TimeFormat specifies the format for timestamp in output. TimeFormat string // PartsOrder defines the order of parts in output. PartsOrder []string // PartsExclude defines parts to not display in output. PartsExclude []string // FieldsExclude defines contextual fields to not display in output. FieldsExclude []string FormatTimestamp Formatter FormatLevel Formatter FormatMessage Formatter FormatContext Formatter FormatMode Formatter FormatFieldName Formatter FormatFieldValue Formatter FormatErrFieldName Formatter FormatErrFieldValue Formatter FormatExtra func(map[string]interface{}, *bytes.Buffer) error }
CodecometWriter parses the JSON input and writes it in an (optionally) colorized, human-friendly format to Out.
func NewCodecometWriter ¶
func NewCodecometWriter(options ...func(w *CodecometWriter)) CodecometWriter
NewCodecometWriter creates and initializes a new CodecometWriter.
type Event ¶
func LoggerForLevel ¶
type Formatter ¶
type Formatter func(interface{}) string
Formatter transforms the input into a formatted string.
type Level ¶
const ( // DebugLevel defines debug log level. DebugLevel Level = iota // InfoLevel defines info log level. InfoLevel // WarnLevel defines warn log level. WarnLevel // ErrorLevel defines error log level. ErrorLevel // FatalLevel defines fatal log level. FatalLevel // PanicLevel defines panic log level. PanicLevel // NoLevel defines an absent log level. NoLevel // Disabled disables the logger. Disabled // TraceLevel defines trace log level. TraceLevel Level = -1 )
Click to show internal directories.
Click to hide internal directories.