logger

package
v1.76.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 6 Imported by: 153

Documentation

Index

Constants

View Source
const (
	// DebugLevel is the debug log level, i.e. the most verbose.
	DebugLevel = "debug"
	// InfoLevel is the default log level.
	InfoLevel = "info"
	// ErrorLevel is a log level where only errors are logged.
	ErrorLevel = "error"

	// FormatJSON is the output type that produces a JSON object per log line.
	FormatJSON = "json"
	// FormatText outputs the log as human-readable text.
	FormatText = "text"
)

Variables

View Source
var (
	// AllLogLevels is a slice of all available log levels.
	AllLogLevels = []string{DebugLevel, InfoLevel, ErrorLevel}
	// AllLogFormats is a slice of all available log formats.
	AllLogFormats = []string{FormatJSON, FormatText}
)

Functions

func MustNewZapLogger added in v1.35.0

func MustNewZapLogger(level string, format string, additionalOpts ...logzap.Opts) logr.Logger

MustNewZapLogger is like NewZapLogger but panics on invalid input.

func NewZapLogger added in v1.29.0

func NewZapLogger(level string, format string, additionalOpts ...logzap.Opts) (logr.Logger, error)

NewZapLogger creates a new logr.Logger backed by Zap.

Types

This section is empty.

Jump to

Keyboard shortcuts

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