Expand description
Host-side scheduler diagnostics on stderr, gated by BYTEFLOW_LOG.
§Why this is separate from the print native
Actor-visible logging (CallNative print) writes to stdout and is part
of the program’s observable behaviour — samples and demos use it to show
envelopes crossing the mailbox. Scheduler diagnostics (spawn / send /
park / finish) are an operator concern: they must not pollute stdout
when an embedder pipes Flow output, and they must stay off by default
so a production run is silent unless asked.
BYTEFLOW_LOG unset / 0 / off / false → silent
BYTEFLOW_LOG=1 / info / true → spawn, send, receive, finish
BYTEFLOW_LOG=debug / 2 → also park, deliver queued/handoff§Lazy init
The level is read from the environment once (first call) and cached in
atomics. That avoids re-parsing std::env on every send in a hot worker
loop. Tests can override via set_level_for_tests.
Functions§
- debug
- DEBUG-level line when
BYTEFLOW_LOGisdebug. - info
- INFO-level line when
BYTEFLOW_LOGis at leastinfo. - set_
level_ for_ tests - Override the cached level (tests only).
0off,1info,2debug.