logging

package
v3.205.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: Apache-2.0 Imports: 9 Imported by: 78

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 ...any)

func FilterString

func FilterString(msg string) string

func Flush

func Flush()

func GetLogfilePath added in v3.192.0

func GetLogfilePath() (string, error)

func Infof

func Infof(format string, args ...any)

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 ...any)

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 ...any)

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 ...any)

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 ...any)

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