logger

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: Apache-2.0 Imports: 5 Imported by: 8

Documentation

Overview

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

Types

type Logger

type Logger interface {
	Debug(msg string, args ...any)
	Info(msg string, args ...any)
	Warn(msg string, args ...any)
	Error(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