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 bugsalot::debug;

debug!("Print stuff\n");
debug!("Print more stuff: {} {} {}\n", 1, "2", 3.0f32);

Platforms

platformmechanismnotes and caveats
Android__android_log_writeView in ADB Logcat.
WASMconsole.logView in Developer Tools (Firefox, Chrome).
WindowsOutputDebugStringABuffer size capped. View in VS’s Ouput tab, VSC’s Debug Console, DebugView, etc.
*nixstderrMay intermingle with other error reporting, subject to change.