Documentation
¶
Index ¶
- Variables
- type LogBuffer
- type LogFormat
- type Logger
- func (l *Logger) AddWriter(writer io.Writer, format LogFormat)
- func (l *Logger) Debug(args ...any)
- func (l *Logger) Error(args ...any)
- func (l *Logger) Info(args ...any)
- func (l *Logger) Level() zerolog.Level
- func (l *Logger) NewSubLogger(key string, value string) *Logger
- func (l *Logger) Panic(args ...any)
- func (l *Logger) RemoveWriter(writer io.Writer)
- func (l *Logger) SetLevel(level zerolog.Level)
- func (l *Logger) Trace(args ...any)
- func (l *Logger) Warn(args ...any)
- type StructuredLogInfo
Constants ¶
This section is empty.
Variables ¶
GlobalLogger describes a Logger that is disabled by default and is instantiated when the fuzzer is created. Each module/package should create its own sub-logger. This allows to create unique logging instances depending on the use case.
Functions ¶
This section is empty.
Types ¶
type LogBuffer ¶
type LogBuffer struct {
// contains filtered or unexported fields
}
LogBuffer is a helper object that can be used to buffer log messages. A log buffer is effectively a list of arguments of any type. This object is especially useful when attempting to log complex objects (e.g. execution trace) that have complex coloring schemes and formatting. The LogBuffer can then be passed on to a Logger object to then log the buffer to console and any other writers (e.g. file).
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger describes a custom logging object that can log events to any arbitrary channel and can handle specialized output to console as well
func NewLogger ¶
NewLogger will create a new Logger object with a specific log level. The Logger can output to console, if enabled, and output logs to any number of arbitrary io.Writer channels
func (*Logger) AddWriter ¶
AddWriter will add a writer to the list of channels where log output will be sent.
func (*Logger) NewSubLogger ¶
NewSubLogger will create a new Logger with unique context in the form of a key-value pair. The expected use of this function is for each package to have their own unique logger so that parsing of logs is "grep-able" based on some key
func (*Logger) RemoveWriter ¶
RemoveWriter will remove a writer from the list of writers that the logger manages. If the writer does not exist, this function is a no-op
type StructuredLogInfo ¶
StructuredLogInfo describes a key-value mapping that can be used to log structured data