Macro veilid_bugsalot::debug
source · macro_rules! debug { ( $format:literal $($tt:tt)* ) => { ... }; }
Expand description
Log (part of) a line to standard debugging channels. Prefer debugln!
Messages should terminate in newlines. Failure to do so will result in inconsistent behavior between debug message viewers, as several of them treat each message as a complete package and effectively terminate them with newlines even if you don’t, but a few don’t, and will instead effectively combine lines.
For example, in DebugView on Windows, debug!("A"); debug!("B");
will display something like:
33 616.02484131 [12584] A
34 616.02490234 [12584] B
But in Visual Studio’s Output tab, or Visual Studio Code’s Debug Console, it will instead display something like:
AB
§Examples
use veilid_bugsalot::debug;
debug!("Print stuff\n");
debug!("Print more stuff: {} {} {}\n", 1, "2", 3.0f32);
§Platforms
platform | mechanism | notes and caveats |
---|---|---|
Android | __android_log_write | View in ADB Logcat. |
WASM | console.log | View in Developer Tools (Firefox, Chrome). |
Windows | OutputDebugStringA | Buffer size capped. View in VS’s Ouput tab, VSC’s Debug Console, DebugView, etc. |
*nix | stderr | May intermingle with other error reporting, subject to change. |