logging

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package logging centralizes MachineProxy slog setup and the custom trace level. It receives configured log levels and writers from command entry points, and feeds the rest of the packages through slog's default logger and logging.LevelTrace.

Index

Constants

View Source
const LevelTrace = slog.Level(-8)

LevelTrace is a custom level below Debug for high-volume diagnostics such as every command execution and connection keepalive.

Variables

This section is empty.

Functions

func JSONValue added in v1.3.3

func JSONValue(v any) string

JSONValue serializes v to a compact JSON string for use as a slog value. Errors are silently discarded; v must be JSON-marshalable.

func ParseLevel

func ParseLevel(s string) slog.Level

ParseLevel converts a human-readable level string to a slog.Level.

func Setup

func Setup(level string, w io.Writer) *slog.Logger

Setup creates and registers a default slog.Logger writing to w at the given level. It replaces the custom "TRACE" level name in output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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