log

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 0 Imported by: 46

Documentation

Overview

Package log defines a logging interface that kind uses This is roughly a minimal subset of klog github.com/kubernetes/klog

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfoLogger added in v0.6.0

type InfoLogger interface {
	// Info is used to write a user facing status message
	//
	// See: Logger.V
	Info(message string)
	// Infof is used to write a Printf style user facing status message
	Infof(format string, args ...interface{})
	// Enabled should return true if this verbosity level is enabled
	// on the Logger
	//
	// See: Logger.V
	Enabled() bool
}

InfoLogger defines the info logging interface kind uses It is roughly a subset of Verbose from github.com/kubernetes/klog

type Level added in v0.6.0

type Level int32

Level is a verbosity logging level for Info logs See also https://github.com/kubernetes/klog

type Logger added in v0.6.0

type Logger interface {
	// Warn should be used to write user facing warnings
	Warn(message string)
	// Warnf should be used to write Printf style user facing warnings
	Warnf(format string, args ...interface{})
	// Error may be used to write an error message when it occurs
	// Prefer returning an error instead in most cases
	Error(message string)
	// Errorf may be used to write a Printf style error message when it occurs
	// Prefer returning an error instead in most cases
	Errorf(format string, args ...interface{})
	// V() returns an InfoLogger for a given verbosity Level
	//
	// Normal verbosity levels:
	// V(0): normal user facing messages go to V(0)
	// V(1): debug messages start when V(N > 0), these should be high level
	// V(2): more detailed log messages
	// V(3+): trace level logging, in increasing "noisiness" ... allowing
	// arbitrarily detailed logging at extremely low cost unless the
	// logger has actually been configured to display these (E.G. via the -v
	// command line flag)
	//
	// It is expected that the returned InfoLogger will be extremely cheap
	// to interact with for a Level greater than the enabled level
	V(Level) InfoLogger
}

Logger defines the logging interface kind uses It is roughly a subset of github.com/kubernetes/klog

type NoopInfoLogger added in v0.6.0

type NoopInfoLogger struct{}

NoopInfoLogger implements the InfoLogger interface and never logs anything

func (NoopInfoLogger) Enabled added in v0.6.0

func (n NoopInfoLogger) Enabled() bool

Enabled meets the InfoLogger interface but always returns false

func (NoopInfoLogger) Info added in v0.6.0

func (n NoopInfoLogger) Info(message string)

Info meets the InfoLogger interface but does nothing

func (NoopInfoLogger) Infof added in v0.6.0

func (n NoopInfoLogger) Infof(format string, args ...interface{})

Infof meets the InfoLogger interface but does nothing

type NoopLogger added in v0.6.0

type NoopLogger struct{}

NoopLogger implements the Logger interface and never logs anything

func (NoopLogger) Error added in v0.6.0

func (n NoopLogger) Error(message string)

Error meets the Logger interface but does nothing

func (NoopLogger) Errorf added in v0.6.0

func (n NoopLogger) Errorf(format string, args ...interface{})

Errorf meets the Logger interface but does nothing

func (NoopLogger) V added in v0.6.0

func (n NoopLogger) V(level Level) InfoLogger

V meets the Logger interface but does nothing

func (NoopLogger) Warn added in v0.6.0

func (n NoopLogger) Warn(message string)

Warn meets the Logger interface but does nothing

func (NoopLogger) Warnf added in v0.6.0

func (n NoopLogger) Warnf(format string, args ...interface{})

Warnf meets the Logger interface but does nothing

Jump to

Keyboard shortcuts

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