Expand description
Diagnostic logging configuration (native only; see the module docs).
Diagnostic logging configuration: tracing targets and filters.
The runtime, the GC, and the compiler emit their internal diagnostics with
plain tracing::debug! / tracing::trace! under a small set of feature
targets — see [FEATURE_TARGETS]. Selecting them is a filter, not an API:
anything that can build a [Targets] filter can turn them on.
Two entry points build that filter for the two hosts that ship in this workspace:
- The
cljrsCLI starts from [base_filter] (its--debug/--tracelevel, with the feature targets pinned off and the codegen crates pinned towarn), layers each-X debug:gc,jitflag on with [apply_x_flag], and installs the result with [init]. - A generated AOT harness calls [
init_from_env], which enables nothing unlessCLJRS_X_FLAGorRUST_LOGasks for it.
An embedding host is free to ignore all of this and install its own subscriber; the emitting code has no opinion.
This module is native-only: tracing-subscriber is a host-side concern and
a wasm32 runtime installs no subscriber. The tracing::debug! call sites
themselves compile everywhere and are inert without one.
Constants§
- FEATURE_
TARGETS - Targets carrying the runtime’s own internal diagnostics.
- NOISY_
TARGETS - Crates whose logging is noisy enough to drown out everything else.
Functions§
- apply_
rust_ log - Replace
basewithRUST_LOG’s filter when that variable is set and non-empty. - apply_
x_ flag - Fold one
-X/CLJRS_X_FLAGspec intofilter. - base_
filter - The filter a host starts from: everything at
default, the codegen crates pinned towarn, and the runtime’sFEATURE_TARGETSpinned off. - init
- Install
filteras the process’s global subscriber, formatting to stderr. - init_
from_ env - Install a subscriber configured entirely from the environment.