Global Logging Control #
Provides a global verbosity flag to control debug output during inference.
How to silence Hesper logs #
Three options, in order of convenience:
Environment variable (recommended for notebooks and CLI):
HESPER_LOG_LEVEL=quiet # or: silent, error, off, 0, false, noneThis is read once at process start by both the Lean and C++ bridge sides. Anything else (or unset) keeps logs ON for backward compat.
Programmatic override (inside a notebook cell, after a stray verbose call has already happened):
import Hesper.Logging #eval Hesper.Logging.setVerbose falseThis flips both Lean and C++ flags at runtime. Subsequent
getDevice/createBuffer/ etc. calls run silently.Per-cell suppression: wrap the noisy code in
IO.FS.withIsolatedStreams.
Global verbosity flag. Default reflects HESPER_LOG_LEVEL; falls
back to true for backward compatibility when the env var is unset.
FFI: Set C++ bridge verbose flag
Set global verbosity (both Lean and C++ bridge)
Equations
Instances For
Check if verbose logging is enabled
Instances For
Print only when verbose mode is on
Equations
- Hesper.Logging.logVerbose msg = do let __do_lift ← Hesper.Logging.isVerbose if __do_lift = true then IO.println msg else pure PUnit.unit