Created
July 31, 2017 22:03
-
-
Save zaydek-old/f287e486288c97c0deda3df63aee09fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.array, std.stdio; | |
enum trace = q{version(verbose) | |
{ | |
writefln("%s> %s", "-".replicate(++depth), split(__PRETTY_FUNCTION__, ".")[$ - 1]); scope(exit) | |
writefln("<%s %s", "-".replicate(depth--), split(__PRETTY_FUNCTION__, ".")[$ - 1]); | |
}}; | |
ulong depth; | |
void main() | |
{ | |
mixin(trace); | |
foo(); | |
} | |
void foo() | |
{ | |
mixin(trace); | |
bar(); | |
} | |
void bar() | |
{ | |
mixin(trace); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment