MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / NewColorFormatter

Function NewColorFormatter

pkg/event/formatter.go:181–183  ·  view source on GitHub ↗

NewColorFormatter constructs a ColorFormatter backed by the given Formatter. If colour is not available in the current environment the returned value behaves identically to the underlying plain Formatter.

(f *Formatter)

Source from the content-addressed store, hash-verified

179// If colour is not available in the current environment the returned value
180// behaves identically to the underlying plain Formatter.
181func NewColorFormatter(f *Formatter) *ColorFormatter {
182 return &ColorFormatter{f: f, enabled: colorizer.IsAnsiEnabled()}
183}
184
185// Format renders the event according to the template. Each {{ .Field }} tag is
186// substituted with a colour-decorated string when colour output is available,

Callers 1

initConsoleFunction · 0.92

Calls 1

IsAnsiEnabledFunction · 0.92

Tested by

no test coverage detected