logging

package
v3.116.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 59

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogToStderr = false // true if logging is being redirected to stderr.
	Verbose     = 0     // >0 if verbose logging is enabled at a particular level.
	LogFlow     = false // true to flow logging settings to child processes.
)

Functions

func AddGlobalFilter

func AddGlobalFilter(filter Filter)

func Errorf

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

func FilterString

func FilterString(msg string) string

func Flush

func Flush()

func Infof

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

func InitLogging

func InitLogging(logToStderr bool, verbose int, logFlow bool)

InitLogging ensures the logging library has been initialized with the given settings.

func Warningf

func Warningf(format string, args ...interface{})

Types

type Filter

type Filter interface {
	Filter(s string) string
}

func CreateFilter

func CreateFilter(secrets []string, replacement string) Filter

type VerboseLogger added in v3.55.0

type VerboseLogger glog.Verbose

VerboseLogger logs messages only if verbosity matches the level it was built with.

It may be used as a boolean to check if it's enabled.

if log := logging.V(lvl); log {
	log.Infoln(expensiveComputation())
}

func V

func V(level glog.Level) VerboseLogger

V builds a logger that logs messages only if verbosity is at least at the provided level.

func (VerboseLogger) Info added in v3.55.0

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

Info is equivalent to the global Info function, guarded by the value of v. See the documentation of V for usage.

func (VerboseLogger) Infof added in v3.55.0

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

Infof is equivalent to the global Infof function, guarded by the value of v. See the documentation of V for usage.

func (VerboseLogger) Infoln added in v3.55.0

func (v VerboseLogger) Infoln(args ...interface{})

Infoln is equivalent to the global Infoln function, guarded by the value of v. See the documentation of V for usage.

Jump to

Keyboard shortcuts

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