Skip to main content

Module net_trace

Module net_trace 

Source
Expand description

Lightweight, env-gated tracing for the networking paths (transport connect, fetch/push negotiation, pack transfer).

Set GRIT_NET_DEBUG=1 to print one-line [grit-net] … markers to stderr before, during, and after each remote operation. Off by default and essentially free when disabled (the gate is read once and the format args are not evaluated). Embedders can consult enabled to interleave their own before/after markers with the library’s.

Functions§

enabled
Whether networking trace output is enabled (GRIT_NET_DEBUG set to something other than empty / 0 / false). Read once and cached.
line
Emit one [grit-net] … trace line to stderr (only when enabled).