debug

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: Apache-2.0 Copyright (c) 2024-2026 Quad4.io

SPDX-License-Identifier: Apache-2.0 Copyright (c) 2024-2026 Quad4.io

Index

Constants

View Source
const (
	DebugCritical = 1
	DebugError    = 2
	DebugInfo     = 3
	DebugVerbose  = 4
	DebugTrace    = 5
	DebugPackets  = 6
	DebugAll      = 7
)

Debug log levels (higher = more verbose).

Variables

This section is empty.

Functions

func GetDebugLevel

func GetDebugLevel() int

GetDebugLevel returns the current debug level.

func GetLogger

func GetLogger() *slog.Logger

GetLogger returns the underlying slog logger. Prefer Log so callers route through the central level filter.

func Init

func Init()

Init builds the underlying slog logger. Safe to call repeatedly; only the first call wires it up. SetDebugLevel rebuilds the handler so the active level can change at runtime.

func Log

func Log(level int, msg string, args ...any)

Log emits msg at the given RNS debug level, suppressing it when the level is above the current threshold.

func SetDebugLevel

func SetDebugLevel(level int)

SetDebugLevel updates the active level and rebuilds the slog handler so the change takes effect immediately.

Types

This section is empty.

Jump to

Keyboard shortcuts

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