golog

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

README

golog

Documentation

Index

Constants

This section is empty.

Variables

Log is the base logger. It delegates to another logr.Logger. You *must* call SetLogger to get any actual logging.

Functions

func NewNullLogger

func NewNullLogger() logr.Logger

func SetLogger

func SetLogger(l logr.Logger)

SetLogger sets a concrete logging implementation for all deferred Loggers.

Types

type DelegatingLogger added in v0.4.1

type DelegatingLogger struct {
	logr.Logger
	// contains filtered or unexported fields
}

DelegatingLogger is a logr.Logger that delegates to another logr.Logger. If the underlying promise is not nil, it registers calls to sub-loggers with the logging factory to be populated later, and returns a new delegating logger. It expects to have *some* logr.Logger set at all times (generally a no-op logger before the promises are fulfilled).

func NewDelegatingLogger added in v0.4.1

func NewDelegatingLogger(initial logr.Logger) *DelegatingLogger

NewDelegatingLogger constructs a new DelegatingLogger which uses the given logger before it's promise is fulfilled.

func (*DelegatingLogger) Fulfill added in v0.4.1

func (l *DelegatingLogger) Fulfill(actual logr.Logger)

Fulfill switches the logger over to use the actual logger provided, instead of the temporary initial one, if this method has not been previously called.

func (*DelegatingLogger) WithName added in v0.4.1

func (l *DelegatingLogger) WithName(name string) logr.Logger

WithName provides a new Logger with the name appended

func (*DelegatingLogger) WithValues added in v0.4.1

func (l *DelegatingLogger) WithValues(tags ...interface{}) logr.Logger

WithValues provides a new Logger with the tags appended

type NullLogger

type NullLogger struct{}

NullLogger is a logr.Logger that does nothing.

func (NullLogger) Enabled

func (NullLogger) Enabled() bool

Enabled implements logr.InfoLogger

func (NullLogger) Error

func (NullLogger) Error(_ error, _ string, _ ...interface{})

Error implements logr.Logger

func (NullLogger) Info

func (NullLogger) Info(_ string, _ ...interface{})

Info implements logr.InfoLogger

func (NullLogger) V

func (log NullLogger) V(_ int) logr.Logger

V implements logr.Logger

func (NullLogger) WithName

func (log NullLogger) WithName(_ string) logr.Logger

WithName implements logr.Logger

func (NullLogger) WithValues

func (log NullLogger) WithValues(_ ...interface{}) logr.Logger

WithValues implements logr.Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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