Documentation ¶
Index ¶
- func Attrs(ctx context.Context) []slog.Attr
- func BodyHook(hook func(e *zerolog.Event, level zerolog.Level, body map[string]interface{})) zerolog.HookFunc
- func ConsoleLoggerForTest(t TB, levels string) log.Logger
- func ConsoleSlogWriter(w io.Writer, color bool) *zerolog.ConsoleWriter
- func DisableDebugFeatures()
- func EnableDebugFeatures()
- func ExcludeMessages(messages ...string) zerolog.HookFunc
- func GetCurrentDateTime() (ymd string, hm string)
- func NewConsoleWriter(format string) (io.Writer, error)
- func NewConsoleWriterWith(w io.Writer, format string) (io.Writer, error)
- func NewSlogHandler(c SlogConfig, out io.Writer) (slog.Handler, error)
- func NewTendermintLogger(zl zerolog.Logger, level string, trace bool) (log.Logger, error)
- func NewTestLogger(t TB, format, level string, trace bool) log.Logger
- func ParseLogLevel(s string, w io.Writer) (string, io.Writer, error)
- func Recover(logger log.Logger, message string, values ...interface{})
- func TestLogWriter(t TB) func(string) (io.Writer, error)
- func TypeOf(v any) any
- func With(ctx context.Context, args ...any) context.Context
- func WithAttrs(ctx context.Context, attrs []slog.Attr) context.Context
- type DataSet
- type DataSetLog
- func (d *DataSetLog) DumpDataSetToDiskFile() ([]string, error)
- func (d *DataSetLog) GetDataSet(id string) *DataSet
- func (d *DataSetLog) Initialize(key string, opts Options)
- func (d *DataSetLog) SetFileTag(parts ...string)
- func (d *DataSetLog) SetHeader(header string)
- func (d *DataSetLog) SetPath(path string)
- func (d *DataSetLog) SetProcessName(process string)
- type FilterWriter
- type LogAsHex
- type LogAsHexSlice
- type LogAsHexValue
- type LogWithFormat
- type NullLogger
- type OptionalLogger
- func (l OptionalLogger) Debug(msg string, keyVals ...interface{})
- func (l OptionalLogger) Error(msg string, keyVals ...interface{})
- func (l OptionalLogger) Info(msg string, keyVals ...interface{})
- func (l *OptionalLogger) Set(m log.Logger, keyVals ...interface{})
- func (l OptionalLogger) With(keyVals ...interface{}) log.Logger
- type Options
- type SlogConfig
- type Slogger
- type StdlogWriter
- type TB
- type TendermintZeroLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BodyHook ¶
func BodyHook(hook func(e *zerolog.Event, level zerolog.Level, body map[string]interface{})) zerolog.HookFunc
BodyHook is a HORRIBLE HACK, really the hackiest of hacks. It filters zerolog messages based on the log body. DO NOT USE THIS except for tests.
func ConsoleLoggerForTest ¶ added in v1.1.0
func ConsoleSlogWriter ¶ added in v1.4.0
func ConsoleSlogWriter(w io.Writer, color bool) *zerolog.ConsoleWriter
ConsoleSlogWriter returns a zerolog console writer that outputs nicely formatted logs.
func DisableDebugFeatures ¶ added in v1.4.0
func DisableDebugFeatures()
func EnableDebugFeatures ¶ added in v1.4.0
func EnableDebugFeatures()
func ExcludeMessages ¶
func GetCurrentDateTime ¶ added in v1.0.0
func NewConsoleWriter ¶
NewConsoleWriter parses the log format and creates an appropriate writer. It is based on part of Tendermint's NewTendermintLogger.
func NewConsoleWriterWith ¶
func NewSlogHandler ¶ added in v1.4.0
func NewTendermintLogger ¶
NewTendermintLogger is the default logger implementation for our Tendermint nodes. It is based on part of Tendermint's NewTendermintLogger.
Types ¶
type DataSet ¶ added in v1.0.0
type DataSet struct {
// contains filtered or unexported fields
}
type DataSetLog ¶ added in v1.0.0
type DataSetLog struct {
// contains filtered or unexported fields
}
func (*DataSetLog) DumpDataSetToDiskFile ¶ added in v1.0.0
func (d *DataSetLog) DumpDataSetToDiskFile() ([]string, error)
func (*DataSetLog) GetDataSet ¶ added in v1.0.0
func (d *DataSetLog) GetDataSet(id string) *DataSet
func (*DataSetLog) Initialize ¶ added in v1.0.0
func (d *DataSetLog) Initialize(key string, opts Options)
func (*DataSetLog) SetFileTag ¶ added in v1.0.0
func (d *DataSetLog) SetFileTag(parts ...string)
func (*DataSetLog) SetHeader ¶ added in v1.0.0
func (d *DataSetLog) SetHeader(header string)
func (*DataSetLog) SetPath ¶ added in v1.0.0
func (d *DataSetLog) SetPath(path string)
func (*DataSetLog) SetProcessName ¶ added in v1.0.0
func (d *DataSetLog) SetProcessName(process string)
type FilterWriter ¶
type FilterWriter struct { Out io.Writer Predicate func(zerolog.Level, map[string]interface{}) bool }
func (FilterWriter) WriteLevel ¶
type LogAsHexSlice ¶ added in v0.5.1
type LogAsHexSlice []LogAsHex
func (LogAsHexSlice) Slice ¶ added in v0.5.1
func (v LogAsHexSlice) Slice(i, j int) LogAsHex
type LogAsHexValue ¶ added in v0.5.1
type LogAsHexValue []byte
func (LogAsHexValue) LogValue ¶ added in v1.2.10
func (v LogAsHexValue) LogValue() slog.Value
func (LogAsHexValue) MarshalJSON ¶ added in v0.5.1
func (v LogAsHexValue) MarshalJSON() ([]byte, error)
func (LogAsHexValue) Slice ¶ added in v0.5.1
func (v LogAsHexValue) Slice(i, j int) LogAsHex
type LogWithFormat ¶ added in v0.6.0
type LogWithFormat struct { Format string Values []interface{} }
func WithFormat ¶ added in v0.6.0
func WithFormat(format string, values ...interface{}) LogWithFormat
func (LogWithFormat) MarshalJSON ¶ added in v0.6.0
func (v LogWithFormat) MarshalJSON() ([]byte, error)
type NullLogger ¶ added in v0.5.1
type NullLogger struct{}
func (NullLogger) Debug ¶ added in v0.5.1
func (NullLogger) Debug(msg string, keyVals ...interface{})
func (NullLogger) Error ¶ added in v0.5.1
func (NullLogger) Error(msg string, keyVals ...interface{})
func (NullLogger) Info ¶ added in v0.5.1
func (NullLogger) Info(msg string, keyVals ...interface{})
func (NullLogger) With ¶ added in v0.5.1
func (l NullLogger) With(keyVals ...interface{}) log.Logger
type OptionalLogger ¶
func (OptionalLogger) Debug ¶
func (l OptionalLogger) Debug(msg string, keyVals ...interface{})
func (OptionalLogger) Error ¶
func (l OptionalLogger) Error(msg string, keyVals ...interface{})
func (OptionalLogger) Info ¶
func (l OptionalLogger) Info(msg string, keyVals ...interface{})
func (*OptionalLogger) Set ¶ added in v1.0.0
func (l *OptionalLogger) Set(m log.Logger, keyVals ...interface{})
func (OptionalLogger) With ¶
func (l OptionalLogger) With(keyVals ...interface{}) log.Logger
type Options ¶ added in v1.0.0
func DefaultOptions ¶ added in v1.0.0
func DefaultOptions() Options
type SlogConfig ¶ added in v1.4.0
type Slogger ¶ added in v1.2.10
type StdlogWriter ¶ added in v1.4.0
type TendermintZeroLogger ¶
TendermintZeroLogger is a Tendermint logger implementation that passes messages to a Zerolog logger. It is basically a complete clone of Tendermint's default logger.
func (*TendermintZeroLogger) Debug ¶
func (l *TendermintZeroLogger) Debug(msg string, keyVals ...interface{})
func (*TendermintZeroLogger) Error ¶
func (l *TendermintZeroLogger) Error(msg string, keyVals ...interface{})
func (*TendermintZeroLogger) Info ¶
func (l *TendermintZeroLogger) Info(msg string, keyVals ...interface{})
func (*TendermintZeroLogger) With ¶
func (l *TendermintZeroLogger) With(keyVals ...interface{}) log.Logger