logger

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package logger provides minimal logging for Voxray. Uses std log; supports log level and optional JSON output.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Default is the standard logger; Info and Debug write to it unless disabled.
	Default = log.New(os.Stderr, "[Voxray] ", log.LstdFlags)
	// DebugEnabled when true allows Debug logs. Set by Configure or directly.
	DebugEnabled = false
)

Functions

func Configure

func Configure(level string, json bool)

Configure sets log level and JSON mode. Level is "debug", "info", or "error" (case-insensitive). When json is true, each log line is a JSON object: {"level":"info","msg":"..."}.

func ConfigureFromConfig

func ConfigureFromConfig(level string, useJSON bool)

ConfigureFromConfig sets log level and JSON mode from config-derived values.

func Debug

func Debug(format string, args ...interface{})

Debug logs a debug message only if level is "debug".

func Error

func Error(format string, args ...interface{})

Error logs an error message.

func Info

func Info(format string, args ...interface{})

Info logs an informational message (unless level is "error").

func WithSession

func WithSession(ctx context.Context, sessionID string) context.Context

WithSession returns a context with the session ID attached for logging or tracing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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