Early review of std.logger
ilya-stromberg
ilya-stromberg-2009 at yandex.ru
Mon Oct 21 01:45:21 PDT 2013
On Monday, 21 October 2013 at 08:37:43 UTC, Robert Schadek wrote:
>> I for once have never seen any log API with
>> log.level = INFO;
>> Logger.log("Here be dragons");
>>
>> And this I believe for a good reason: in 99% of production
>> code I've
>> seen, several log levels are mixed, i.e INFO, CRITICAL and
>> DEBUG for
>> instance, so the case where a single log level is used, even
>> in the
>> same method, just never happens. The proposed solution looks
>> extremely
>> inconvenient to me as it will almost always necessit two lines
>> of code
>> instead of one.
> How good than, that you can pass the LogLevel as first argument
> to the
> log function.
We repeat many times: you can add
Logger.logInfo("Here be dragons");
syntax. It's much better than
Logger.log(LogLevel.Info, "Here be dragons");
More information about the Digitalmars-d
mailing list