Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCannotParseTemplate = errors.New("cannot parse template")
ErrCannotParseTemplate is an error indicating that a template cannot be parsed
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter func(interface{}) string
Formatter is a function type that formats a value as a string
type PtermWriter ¶
type PtermWriter struct {
MaxWidth int
Out io.Writer
LevelStyles map[zerolog.Level]*pterm.Style
Tmpl *template.Template
DefaultKeyStyle func(string, zerolog.Level) *pterm.Style
DefaultValFormatter func(string, zerolog.Level) Formatter
KeyStyles map[string]*pterm.Style
ValFormatters map[string]Formatter
KeyOrderFunc func(string, string) bool
}
PtermWriter is a custom writer for zerolog that formats log events using pterm
func NewPtermWriter ¶
func NewPtermWriter(options ...func(*PtermWriter)) *PtermWriter
NewPtermWriter creates a new PtermWriter with the provided options
func (*PtermWriter) WriteLevel ¶
Click to show internal directories.
Click to hide internal directories.