Documentation
¶
Index ¶
Constants ¶
View Source
const ( Ldate = 1 << iota Ltime Lmicroseconds Llongfile Lshortfile Lfuncname Lshortfuncname LUTC Llevelinitial Llevel LstdFlags = Ldate | Ltime | Lshortfile | Lshortfuncname | Llevelinitial )
Variables ¶
This section is empty.
Functions ¶
func AppendColors ¶
func ColorBytes ¶
Types ¶
type CliOption ¶
type CliOption int
const ( Reset CliOption = iota Bold Faint Italic Underline BlinkSlow BlinkRapid ReverseVideo Concealed CrossedOut )
Style options
Foreground colors
Background colors
func ColorForLevel ¶
type JsonFormatter ¶
type JsonFormatter struct {
*logfrog.BaseLogFormatter
Pretty bool
Prefix string
Indent string
AppendNewline bool
}
func NewJsonFormatter ¶
func NewJsonFormatter(appendNewline bool) *JsonFormatter
func NewPrettyJsonFormatter ¶
func NewPrettyJsonFormatter(prefix string, indent string, appendNewline bool) *JsonFormatter
type TextFormatter ¶
type TextFormatter struct {
*logfrog.BaseLogFormatter
Colorize bool
Flags int
Styles *TextFormatterStyles
}
func NewTextFormatter ¶
func NewTextFormatter(colorize bool, flags int) *TextFormatter
func NewTextFormatterWithStyles ¶
func NewTextFormatterWithStyles(colorize bool, flags int, styles *TextFormatterStyles) *TextFormatter
type TextFormatterStyles ¶
type TextFormatterStyles struct {
DateTimeStyle []CliOption
FileStyle []CliOption
CallerStyle []CliOption
LogLevelStyles map[logfrog.LogLevel][]CliOption
}
func (TextFormatterStyles) GetLogLevelStyle ¶
func (s TextFormatterStyles) GetLogLevelStyle(level logfrog.LogLevel) []CliOption
Click to show internal directories.
Click to hide internal directories.