Review: std.logger

Dragos Carp via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 13 09:02:02 PDT 2014


> I am kind of fine both ways, it is not that big deal but I 
> remember being very surprised that most common use case is 
> called `logf` and much less common - `log`. For `write` 
> function family common usage pattern is a bit different.

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...);

This is a library: you can always add names, but it is very hard
to remove them. If next version of std.logger should support
something like logFirstN or logEveryN (ideas from Google log
library). How this should look like? logfnf, logenf...?


More information about the Digitalmars-d mailing list