Documentation ¶
Overview ¶
Package zlog contains some very simple go-logr / zerologr helper functions. This sets the default timestamp format to time.RFC3339 with ms precision.
Index ¶
- Constants
- func MaybeConsoleWriter(w io.Writer) io.Writer
- func New(w io.Writer) logr.Logger
- func NewLevelWriter(threshold zerolog.Level, ws ...io.Writer) *levelWriter
- func NewZerolog(w io.Writer) zerolog.Logger
- func SetLevel(lgr logr.Logger, level zerolog.Level)
- func SetOutput(lgr logr.Logger, w io.Writer)
Constants ¶
View Source
const ( TraceLevel = zerolog.TraceLevel InfoLevel = zerolog.InfoLevel )
Variables ¶
This section is empty.
Functions ¶
func MaybeConsoleWriter ¶ added in v0.22.1
MaybeConsoleWriter returns a zerolog.ConsoleWriter if w is a terminal, and w unchanged otherwise.
func New ¶ added in v0.22.0
New returns a new logr.Logger writing to w as a zerolog.Logger, at InfoLevel.
func NewLevelWriter ¶
NewLevelWriter returns a new zerolog.LevelWriter that discards messages under the given threshold, and writes to all the specified writers.
func NewZerolog ¶ added in v0.22.0
NewZerolog returns a new zerolog.Logger writing to w.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.