logger

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

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

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

MustNewZapLogger is like NewZapLogger but panics on invalid input.

func NewZapLogger

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