adapters

package
v1.3.44 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscoveredLogger

type DiscoveredLogger struct {
	Name  string
	Level string // smplkit level string
}

DiscoveredLogger represents a logger found during discovery.

type LoggingAdapter

type LoggingAdapter interface {
	// Name returns a human-readable adapter name for diagnostics (e.g., "slog").
	Name() string

	// Discover scans the runtime for existing loggers.
	// Returns a list of discovered loggers with their names and levels.
	Discover() []DiscoveredLogger

	// ApplyLevel sets the level on a specific logger.
	// loggerName is the original (non-normalized) name.
	// level is a smplkit LogLevel string (e.g., "DEBUG", "INFO", "WARN").
	ApplyLevel(loggerName string, level string)

	// InstallHook installs a continuous discovery hook.
	// The callback receives (original_name, smplkit_level_string) whenever
	// a new logger is created in the framework.
	// May be a no-op if the framework doesn't support creation interception.
	InstallHook(onNewLogger func(name string, level string))

	// UninstallHook removes the hook installed by InstallHook.
	// Called on client Close().
	UninstallHook()
}

LoggingAdapter is the interface for logging framework integration.

Implement this interface to add smplkit level control for a logging framework (e.g., slog, zap).

Jump to

Keyboard shortcuts

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