plans for macros

Steven Schveighoffer schveiguy at
Thu May 15 10:57:55 PDT 2008

Yes, but turning on debug levels is a compile-time thing.  Many times, you 
want to log based on a run-time decision, i.e. a command line switch.

Your solution does not work in this case.


"boyd" wrote
I use nearly that exact syntax in my project:

     debug Log(5, "blar", 10.0f);

The Log function is built using a simple template:

     void Log(T...)(T t)

As far as syntax goes that's in my opinion pretty nice. And the function
isn't even called if debug is off. You can easily adapt it to work with
debug levels:


So, this is in my opinion a problem that doesn't really need macro's to
solve it.


More information about the Digitalmars-d-learn mailing list