Voting: std.logger

Robert burner Schadek via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 8 02:16:09 PDT 2014


On Friday, 1 August 2014 at 15:52:30 UTC, Martin Nowak wrote:
> Well phobos as a library is precompiled, so the versions used 
> to compile phobos will be relevant, not the ones in client code.
>
> For templated functions version identifier will "leak" from 
> client code into the library, because technically they are 
> instantiated by the client code.

could you elaborate please? Currently I use the version 
statements in two template functions. I'm not sure why one would 
brand this negatively as a leak into the library.

>
> Also the version identifiers of client code determine which 
> declarations you see.
>
> Relying on this would be a constant source of bugs.

could you elaborate please?

>
> I did proof-of-concept yesterday using type tags and template 
> constraints to statically disable certain log levels.
> It also has some drawbacks because LogLevel is no longer a 
> plain enum, but it's more appropriate than version identifiers.
> http://forum.dlang.org/post/lrf362$tkn$1@digitalmars.com

Thank you for taking the time, but I found several conceptional 
problems with that POC. The worst being that if I make the 
LogLevel inside the TestLogger anything other than a enum it 
fails, as it is used in the template constraint. That would mean 
the LogLevel is fixed at CT.



More information about the Digitalmars-d mailing list