std.experimental.logger formal review round 3

Robert burner Schadek via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 27 01:22:06 PDT 2014


On Sunday, 26 October 2014 at 23:58:14 UTC, Martin Nowak wrote:
> On 10/27/2014 12:45 AM, Martin Nowak wrote:
>> If you allow to define a Logger with a LogLevel know at 
>> compile time and
>> you statically pass the LogLevel of your message to the 
>> logging function
>> you can elide that call. For anything else you need a runtime 
>> check.
>
> You are trying to globally define a LogLevel through the 
> version identifier but that collides with D's separate 
> compilation.
> So you cannot enable logging in a library that was compiled 
> with StdLoggerDisableLogging. And vice versa you cannot 
> statically disable logging in a library compiled without 
> StdLoggerDisableLogging.
>
> Now if you use StdLoggerDisableLogging in your program the 
> effect on the library will depend on whether or not you're 
> calling a templated function or if the compiler inlined certain 
> library function into your program.

It is a good think then that the *DisableLogging versions are 
only used inside a template that is used inside a templates. 
Though version statements attached to a phobos compilation should 
only have impact on the unittest of phobos.

Secondly, why would phobos be shipped with certain LogLevel 
disabled.


More information about the Digitalmars-d mailing list