std.experimental.logger formal review round 3

Robert burner Schadek via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 28 02:46:16 PDT 2014


On Tuesday, 28 October 2014 at 05:44:48 UTC, Andrei Alexandrescu 
wrote:
> Being able to select maximum logging level statically at client 
> application level is a deal maker/breaker for me. The mechanics 
> aren't important but it's likely they will affect the API. So I 
> think that needs to be resolved now, not in a future pull 
> request.
>
> Andrei

please elaborate. It is a must to be able to disable LogLevel 
when calling the compiler? Xor the opposite?

passing -version=StdLoggerDisableTrace when compiling the user 
code will yield empty functions (thank you static if) for every 
call to any function or method having the word "trace" in its 
name, like for example trace("My log call");

If you call something like log(computeMyLogLevelAtRuntime(), "my 
log data)
and that function returns LogLevel.trace and you haved passed 
-version=StdLoggerDisableTrace at CT of the user code you will 
have to pay for one if.


More information about the Digitalmars-d mailing list