Skip to main content

enable_debug

Function enable_debug 

Source
pub fn enable_debug(
    state: &DebugStateRef,
    log_state: &LogStateRef,
    options: Option<&DebugOptions>,
)
Expand description

Enables a debug session (TS enableDebug). It installs options.sink, raises the global level (default LogLevel::Debug) and the channels of the selected subsystems plus options.channels, then runs each selected subsystem’s guard enabler in order. options.subsystems selects registered subsystems by name (unregistered names are skipped); omitted, every registered subsystem is switched on. A second call while enabled is a no-op.

A guard enabler that panics (the source’s throw) unwinds the whole transaction: every subsystem already switched on, the failing one included, runs its disabler newest first, the sink is removed and every level is restored, each step continuing past its own failure, and then the original panic resumes. An omitted options.sink installs a console sink with the level-prefixed text formatter (create_console_log_sink), as the source does.