How to use isLoggingEnabled?
andre at s-e-a-p.de
Mon Sep 21 11:21:53 UTC 2020
I am confused by the description of isLoggingEnabled.
In my unittest version I want to disable logging and use this
sharedLog = new NullLogger(LogLevel.off);
If have some stdout writeln coding (to avoid the timestamp /
private void printRuntimeLog(string logFilePath)
import std.stdio : stdout;
"[runtime-log] " ~ line).each!(line => stdout.writeln(line));
I just want to check whether LogLevel.info or more is active. But
the method isLoggingEnabled seems to expect the LogLevel 3 times?
@safe bool isLoggingEnabled()(LogLevel ll, LogLevel loggerLL,
LogLevel globalLL, lazy bool condition = true);
Another strange thing is, the description of isLogginEnabled
(https://dlang.org/phobos/std_experimental_logger_core.html#.isLoggingEnabled) mentions a call with only 1 logLevel argument, but this method does not seems to exist:
> pure bool isLoggingEnabled()(LogLevel ll) @safe nothrow @nogc
Is there an easy way to check if log level is "info" or more?
More information about the Digitalmars-d-learn