Documentation
¶
Index ¶
Constants ¶
View Source
const ( PrefixKeyName = "prefix" TFBinaryKeyName = "tfBinary" NoneLevel = logrus.Level(10) )
Variables ¶
This section is empty.
Functions ¶
func NewPrefixStyle ¶
func NewPrefixStyle() *prefixStyle
Types ¶
type ColorScheme ¶
type ColorScheme map[ColorStyleName]ColorStyle
func (ColorScheme) Compile ¶
func (scheme ColorScheme) Compile() compiledColorScheme
type ColorStyle ¶
type ColorStyle string
func (ColorStyle) ColorFunc ¶
func (style ColorStyle) ColorFunc() ColorFunc
type ColorStyleName ¶
type ColorStyleName byte
const ( None ColorStyleName = iota InfoLevelStyle WarnLevelStyle ErrorLevelStyle FatalLevelStyle PanicLevelStyle DebugLevelStyle TraceLevelStyle TFBinaryStyle TimestampStyle )
type Formatter ¶
type Formatter struct { // Disable formatted layout DisableLogFormatting bool // Force disabling colors. For a TTY colors are enabled by default. DisableColors bool // Disable the conversion of the log levels to uppercase DisableUppercase bool // Timestamp format to use for display when a full timestamp is printed. TimestampFormat string // The fields are sorted by default for a consistent output. DisableSorting bool // Wrap empty fields in quotes if true. QuoteEmptyFields bool // Can be set to the override the default quoting character " with something else. For example: ', or `. QuoteCharacter string // PrefixStyle is used to assign different styles (colors) to each prefix. PrefixStyle PrefixStyle // contains filtered or unexported fields }
func NewFormatter ¶
func NewFormatter() *Formatter
NewFormatter returns a new Formatter instance with default values.
func (*Formatter) SetColorScheme ¶
func (formatter *Formatter) SetColorScheme(colorScheme *ColorScheme)
type PrefixStyle ¶
Click to show internal directories.
Click to hide internal directories.