zlog

package
v0.25.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

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

View Source
const (
	TraceLevel = zerolog.TraceLevel
	InfoLevel  = zerolog.InfoLevel
)

Variables

This section is empty.

Functions

func MaybeConsoleWriter added in v0.22.1

func MaybeConsoleWriter(w io.Writer) io.Writer

MaybeConsoleWriter returns a zerolog.ConsoleWriter if w is a terminal, and w unchanged otherwise.

func New added in v0.22.0

func New(w io.Writer) logr.Logger

New returns a new logr.Logger writing to w as a zerolog.Logger, at InfoLevel.

func NewLevelWriter

func NewLevelWriter(threshold zerolog.Level, ws ...io.Writer) *levelWriter

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

func NewZerolog(w io.Writer) zerolog.Logger

NewZerolog returns a new zerolog.Logger writing to w.

func SetLevel added in v0.22.0

func SetLevel(lgr logr.Logger, level zerolog.Level)

SetLevel sets the level on the underlying zerolog.Logger, directly.

func SetOutput added in v0.22.0

func SetOutput(lgr logr.Logger, w io.Writer)

SetOutput sets the output on the underlying zerolog.Logger, directly.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL