Debug output functions

Mike Parker aldacron at gmail.com
Tue Jul 3 03:32:25 PDT 2012


On 7/3/2012 12:12 PM, Wouter Verhelst wrote:
>
> So, I wanted to create a number of functions that would call write(),
> writef(), writefln(), or writeln() with whatever arguments they were
> given, but only if the user had used a 'enable debugging' command-line
> option (or some such).
>
> What I first did was this:
>
> module debugout;
>
> int debuglevel;


Are you aware of debug conditions?

http://dlang.org/version.html#debug

They can be set on the command line or in code at module level. In the 
former case, it's global. In the latter, only module scope.


More information about the Digitalmars-d-learn mailing list