klogx

package
v0.0.0-...-0c26da3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxPodsLogged is the maximum number of pods for which we will
	// log detailed information every loop at verbosity < 5.
	MaxPodsLogged = 20
	// MaxPodsLoggedV5 is the maximum number of pods for which we will
	// log detailed information every loop at verbosity >= 5.
	MaxPodsLoggedV5 = 1000
	// MaxNodesLogged is the maximum number of nodes for which we will
	// log detailed information every loop at verbosity < 5.
	MaxNodesLogged = 20
	// MaxNodesLoggedV5 is the maximum number of nodes for which we will
	// log detailed information every loop at verbosity >= 5.
	MaxNodesLoggedV5 = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Quota

type Quota struct {
	// contains filtered or unexported fields
}

Quota represents the amount of log lines that can still be printed before suppression starts.

func NewLoggingQuota

func NewLoggingQuota(n int) *Quota

NewLoggingQuota returns a Quota object with limit & left set to the passed value.

func NodesLoggingQuota

func NodesLoggingQuota() *Quota

NodesLoggingQuota returns a new quota with default limit for nodes at current verbosity.

func PodsLoggingQuota

func PodsLoggingQuota() *Quota

PodsLoggingQuota returns a new quota with default limit for pods at current verbosity.

func (*Quota) Left

func (q *Quota) Left() int

Left returns how much Quota was left. If it was exceeded, the value will be negative.

func (*Quota) Reset

func (q *Quota) Reset()

Reset resets left Quota to initial limit.

type Verbose

type Verbose struct {
	// contains filtered or unexported fields
}

Verbose is a wrapper for klog.Verbose that implements UpTo and Over. It provides a subset of methods exposed by klog.Verbose.

func V

func V(n klog.Level) Verbose

V calls V from glog and wraps the result into glogx.Verbose.

func (Verbose) Info

func (v Verbose) Info(args ...interface{})

Info is a wrapper for klog.Info that logs if the Quota allows for it.

func (Verbose) Infof

func (v Verbose) Infof(format string, args ...interface{})

Infof is a wrapper for klog.Infof that logs if the Quota allows for it.

func (Verbose) Over

func (v Verbose) Over(q *Quota) Verbose

Over calls Over from this package if called on true object. The returned value is of type Verbose.

func (Verbose) UpTo

func (v Verbose) UpTo(q *Quota) Verbose

UpTo calls UpTo from this package if called on true object. The returned value is of type Verbose.

Jump to

Keyboard shortcuts

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