Review: std.logger

Jeremy Powers via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 13 10:13:24 PDT 2014


>
> If we get rid of the write style variant, then you need to
> remember just one name with 4 overloads:
>
> log(string message);
> log(string format, Args...);
> log(bool condition, string message);
> log(bool condition, string format, Args...);
>
>
But you would also have to remember that log(...) behaves like writef(...)
and not write(...)

Having consistency with the already existing write methods is a good thing.
 And having both options is useful, as some prefer one over the other (and
you can do more interesting logging things with a list of items to log when
you aren't restricted by a format string).

On the conditional log methods: +1 to not having them, I believe that they
are more complicating than useful.  They muddy the responsibility of
logging, putting program logic along with log level configuration to decide
what to log.  They are an easy thing to add as an extension to the logging
library, no need to include them in the base logging API.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140713/75777d28/attachment.html>


More information about the Digitalmars-d mailing list