Simple log utils for debugging in Rust.
- 🦀 Enabled only in debug mode when
DEBUGenvironment variable is set. You can change theDEBUGvalue in runtime as well byset_debug. - 🔊 Only log in files whose paths match
DEBUG="filename". Match all by usingDEBUG="", orDEBUG="*" - 📦 Group output with
debug_group - 📤 WASM support. It will use the console API
The output log is super easy to read on VS Code with sticky scroll enabled.
Example
use ;
Run with DEBUG=* cargo run
Output
A Group {
Sub A Group {
[src/lib.rs:144] &arr = [
0,
1,
2,
]
Sub Sub A Group {
[src/lib.rs:147] &arr = [
0,
1,
2,
]
}
[src/lib.rs:150] Hi
[src/lib.rs:151] &arr = [
0,
1,
2,
]
}
B Group {
[src/lib.rs:157] END
}
}