Hello.
Need advice:
Is it possible analyze "debug" condition in template, obtained from instantiation place?
Like we using __LINE__ ?

For example, i have template for logging:
```d
void logf(string func = __FUNCTION__, int line = __LINE__, A...)(string fmt, A args)
{
    // here i want analyze, if debug == func
    // and writef conditionally
    writefln("%s:%d " ~ fmt, func, line, args);
}
```

And i want switch on logging for one function module1.func(),
then i declare in module1
```d
debug = func1;  // enable logging for func1

void func1()
{
    ...
    logf("var1=%d", var1);
    ...
}
```

And i want to check in logf()() template: is debug condition equal function name, which instantiate logf() template.

Just advise me direction or proper keyword ...
Thanks.

Reply via email to