logger

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

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 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 ToLogr added in v0.0.19

func ToLogr(logger Logger) logr.Logger

ToLogr returns a logr.Logger that uses the given 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)
}

Logger provides a unified interface for logging

var Log Logger

Log is a global logger instance

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