logger

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package logger provides a logging capability for toolhive for running locally as a CLI and in Kubernetes

Package logger provides a logging capability for toolhive for running locally as a CLI and in Kubernetes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug added in v0.0.33

func Debug(msg string, args ...any)

Debug logs a message at debug level using the singleton logger.

func Debugf added in v0.0.33

func Debugf(msg string, args ...any)

Debugf logs a message at debug level using the singleton logger.

func Error added in v0.0.33

func Error(msg string, args ...any)

Error logs a message at error level using the singleton logger.

func Errorf added in v0.0.33

func Errorf(msg string, args ...any)

Errorf logs a message at error level using the singleton logger.

func Info added in v0.0.33

func Info(msg string, args ...any)

Info logs a message at info level using the singleton logger.

func Infof added in v0.0.33

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

Infof logs a message at info level using the singleton logger.

func Initialize

func Initialize()

Initialize creates and configures the appropriate logger. If the UNSTRUCTURED_LOGS is set to true, it will output plain log message with only time and LogLevelType (INFO, DEBUG, ERROR, WARN)). Otherwise it will create a standard structured slog logger

func NewLogr added in v0.0.33

func NewLogr() logr.Logger

NewLogr returns a logr.Logger which uses the singleton logger.

func Panic added in v0.0.34

func Panic(msg string)

Panic logs a message at error level using the singleton logger and panics the program.

func Panicf added in v0.0.34

func Panicf(msg string, args ...any)

Panicf logs a message at error level using the singleton logger and panics the program.

func Warn added in v0.0.33

func Warn(msg string, args ...any)

Warn logs a message at warning level using the singleton logger.

func Warnf added in v0.0.33

func Warnf(msg string, args ...any)

Warnf logs a message at warning level using the singleton logger.

Types

type Logger

type Logger interface {
	Debug(msg string, args ...any)
	Debugf(msg string, args ...any)
	Info(msg string, args ...any)
	Infof(msg string, args ...any)
	Warn(msg string, args ...any)
	Warnf(msg string, args ...any)
	Error(msg string, args ...any)
	Errorf(msg string, args ...any)
	Panic(msg string)
	Panicf(msg string, args ...any)
}

Logger provides a unified interface for logging

func GetLogger

func GetLogger(component string) Logger

GetLogger returns a context-specific logger

Jump to

Keyboard shortcuts

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