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)
| 179 | // If colour is not available in the current environment the returned value |
| 180 | // behaves identically to the underlying plain Formatter. |
| 181 | func 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, |
no test coverage detected