log

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package log contains utilities for fetching a new logger when one is not already available.

The Log Handle

This package contains a root logr.Logger Log. It may be used to get a handle to whatever the root logging implementation is. By default, no implementation exists, and the handle returns "promises" to loggers. When the implementation is set using SetLogger, these "promises" will be converted over to real loggers.

Logr

All logging in controller-runtime is structured, using a set of interfaces defined by a package called logr (https://godoc.org/github.com/go-logr/logr). The sub-package zap provides helpers for setting up logr backed by Zap (go.uber.org/zap).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Development configures the logger to use a Zap development config
	// (stacktraces on warnings, no sampling), otherwise a Zap production
	// config will be used (stacktraces on errors, sampling).
	Development bool
	// Encoder configures how Zap will encode the output. Defaults to
	// console
	Encoder string
	// Level configures the verbosity of the logging. Defaults to Debug when
	// Development is true and Info otherwise
	Level int
	// Stacktrace enables stacktrace in log messages. Defaults to false
	Stacktrace bool
}

Options contains all possible settings

func (*Options) BindFlags

func (o *Options) BindFlags(fs *flag.FlagSet)

BindFlags will parse the given flagset for zap option flags and set the log options accordingly

 zap-devel: Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn)
			  Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error)
 zap-encoder: Zap log encoding (one of 'json' or 'console')
 zap-log-level:  Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error',
			       or any integer value > 0 which corresponds to custom debug levels of increasing verbosity")
 zap-stacktrace-level: Zap Level at and above which stacktraces are captured (one of 'info' or 'error')

Jump to

Keyboard shortcuts

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