log

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 33

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Logger The global logger
	Logger logr.Logger
)

Functions

func Fatal

func Fatal(logger logr.Logger, msg string, keysAndValues ...interface{})

Fatal log the message using the passed logger and terminate.

func FromContextOrGlobal

func FromContextOrGlobal(ctx context.Context) logr.Logger

FromContextOrGlobal return a logger from the passed context or the global logger.

func GetLogLevel added in v1.2.4

func GetLogLevel() string

GetLogLevel returns the current log level as a string.

func NSMLogger

func NSMLogger(logger logr.Logger) nsmlog.Logger

NSMLogger return a logger to use for NSM logging.

func New

func New(name, level string) logr.Logger

New returns a new logger. The level may be "DEBUG" (V(1)) or "TRACE" (V(2)), any other string (e.g. "") is interpreted as "INFO" (V(0)). On first call the global Logger is set. The log level is stored in a package-level (global) variable. Any call to New(...) updates this shared log level for all loggers, including the initially created global Logger.

func SetupLevelChangeOnSignal added in v1.2.4

func SetupLevelChangeOnSignal(ctx context.Context, signals map[os.Signal]string, opts ...Option)

SetupLevelChangeOnSignal sets the log level dynamically based on incoming OS signals.

Types

type Option added in v1.2.4

type Option func(level string)

func WithNSMLogger added in v1.2.4

func WithNSMLogger() Option

Jump to

Keyboard shortcuts

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