Early review of std.logger

Robert Schadek realburner at gmx.de
Tue Oct 15 07:25:46 PDT 2013


On 10/15/2013 04:17 PM, ilya-stromberg wrote:
> On Tuesday, 15 October 2013 at 14:12:38 UTC, Sönke Ludwig wrote:
>> But if it's available people _will_ use it in complex contexts. Also
>> if the writer of a 2<<8 loc library uses it and the library is used
>> by a large piece of software, that will also be affected. The point
>> is that it is unhygienic and requires non-trivial extra work when
>> using a logger in a multi-threaded environment. Some kind of scoped
>> stack of default log levels would get around this issue, but that
>> smells like over engineering.
>
> +1
> I dislike syntax:
> log.logLevel = LogLevel.warning;
> log("This is a warning");
>
> Much better:
> log.warning("This is a warning");
You can also write log(LogLevel.warning, "This is a warning"); And that
also allows you to treat the LogLevel as a variable.
log(myComputedLogLevel, "..."); Anyway, functions should be verbs.



More information about the Digitalmars-d mailing list