std.experimental.logger formal review round 3
Martin Nowak via Digitalmars-d
digitalmars-d at puremagic.com
Sun Oct 26 15:57:39 PDT 2014
On 10/26/2014 11:27 PM, Robert burner Schadek wrote:
> it is not really a dependency as the one template that uses the version
> identifier uses them optionally.
It simply doesn't work, e.g. you could not statically disable logging in
phobos without recompiling phobos.
cat > lib.d << CODE
version (StdLoggerDisableLogging)
enum isLoggingActive = false;
else
enum isLoggingActive = true;
void doSome()
{
import std.stdio;
writeln("isLoggingActive: ", isLoggingActive);
}
CODE
cat > main.d << CODE
import lib, std.stdio;
void main()
{
writeln("isLoggingActive: ", isLoggingActive);
doSome();
}
CODE
dmd -version=StdLoggerDisableLogging -lib lib.d
dmd main lib.a
./main
More information about the Digitalmars-d
mailing list