std.logger

Craig Dillabaugh cdillaba at cg.scs.carleton.ca
Thu Aug 22 15:06:17 PDT 2013


On Thursday, 22 August 2013 at 21:36:50 UTC, David Nadlinger
wrote:
> On Thursday, 22 August 2013 at 15:51:53 UTC, Craig Dillabaugh 
> wrote:
>> Do you really find the three extra characters a big problem.
>
> They are unnecessary. If you want to make clear you are dealing 
> with logging, you can just write something along the lines of:
>
> import log = std.logger;
> log.error("123");
>
> David

I think the two solutions are pretty close in terms of
readability.  Of course the solution here uses convention to
ensure clarity in what the log functions are doing, while
logError() enforces clarity.  I could do:

import px482374203 = std.logger;

....

//much later
px482374203.error("What the heck is this!");

Not that I would ever do that ...

Also just to be nit-picky you are typing 4 extra characters which
is 25% worse than my suggestion :o)
[ In fairness having to use the shift key to type logError()
likely makes log.error() just a bit easier to type.]


More information about the Digitalmars-d mailing list