feat(stack): adds a call macro with depth delta

Implements #9
This commit is contained in:
Johann Dreo 2023-01-29 21:28:11 +01:00
commit d5aa2d829b
3 changed files with 99 additions and 15 deletions

View file

@ -566,6 +566,23 @@ CLUTCHCODE(info,
```
Manually Increase Stack Depth
-----------------------------
You may want to manually increase the stack depth for a given logging call,
for instance to subdivise a single function in sections.
To do so, you can use the `CLUTCHLOGD` macro, which take an additional argument,
in the form of the number of additional (fake) stack depths you want:
```cpp
CLUTCHLOG( debug, "Call"); // Regular macro.
CLUTCHLOGD(debug, "Sub call", 1); // Adds an additional (fake) stack depth.
CLUTCHLOGD(debug, "Sub sub!", 2); // Adds two additional (fake) stack depths.
```
That way, the depth will be rendered to the actual depth, plus the additional
depth delta. Note that the displayed function will stay the same. Any filtering
on the stack depth will take into account the fake depth and not the real one.
Examples
========