MCPcopy
hub / github.com/sirupsen/logrus / Formatter

Interface Formatter

formatter.go:26–28  ·  formatter.go::Formatter

The Formatter interface is used to implement a custom Formatter. It takes an `Entry`. It exposes all the fields, including the default ones: * `entry.Data["msg"]`. The message passed from Info, Warn, Error .. * `entry.Data["time"]`. The timestamp. * `entry.Data["level"]. The level the entry was log

Source from the content-addressed store, hash-verified

24// `entry.Data`. Format is expected to return an array of bytes which are then
25// logged to `logger.Out`.
26type Formatter interface {
27 Format(*Entry) ([]byte, error)
28}
29
30// This is to not silently overwrite `time`, `msg`, `func` and `level` fields when
31// dumping it. If this code wasn't there doing:

Callers 8

BytesMethod · 0.65
writeMethod · 0.65
doBenchmarkFunction · 0.65
FormatMethod · 0.65
FormatMethod · 0.65

Implementers 2

JSONFormatterjson_formatter.go
TextFormattertext_formatter.go

Calls

no outgoing calls

Tested by

no test coverage detected