debuglog

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package debuglog provides a process-wide structured debug-event sink used to diagnose daemon-mode routing decisions (session creation, descendant joins, ancestor-walk welds, trace-id mismatches, etc.).

The sink is off by default: L is a Nop logger and all call sites are effectively free. Callers enable it by calling Init with a file path — typically from a CLI flag (--debug-log) or PROCESS_TRACER_DEBUG_LOG env var. When enabled, every event is written as one JSON object per line, suitable for jq / spreadsheet analysis.

Index

Constants

This section is empty.

Variables

L is the process-wide debug logger. Starts as a Nop; Init redirects it to a file. Zap's Nop core discards fields cheaply so call sites are safe to leave in hot paths.

Functions

func Enabled

func Enabled() bool

Enabled reports whether L is currently writing (i.e. Init was called with a non-empty path and cleanup hasn't run). Call sites that want to skip expensive field preparation can guard on this. Zap itself no-ops on Nop, so cheap log calls don't need the guard.

func Init

func Init(path string) (cleanup func(), err error)

Init opens path for append-only writes and replaces L with a JSON-encoded zap logger. An empty path leaves L as Nop and returns a no-op cleanup. Intended to be called once, early in daemon startup.

Types

This section is empty.

Jump to

Keyboard shortcuts

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