std.logger

Craig Dillabaugh cdillaba at cg.scs.carleton.ca
Thu Aug 22 09:01:05 PDT 2013


On Thursday, 22 August 2013 at 15:51:53 UTC, Craig Dillabaugh
wrote:
> On Thursday, 22 August 2013 at 15:41:40 UTC, Robert Schadek 
> wrote:
>> On 08/22/2013 05:38 PM, Robert Schadek wrote:
>>> logMessage is meant to do the actual logging. And IMO it is 
>>> to much to long.
>>> But keep the ideas coming there must be a sweet spot 
>>> somewhere.
>>>
>> sry, logMessage is meant to figure out if the LogLevel of the 
>> message
>> makes it worthy to be printed
>> and to disable the logging via version(DisableLogger).
>>
>> writeLogMsg does the actual logging
>
> Do you really find the three extra characters a big problem.
>
> Log() vs. logLog()  //OK, that is kind of ugly.
> Info() vs logInfo()
> Warning() vs logWarning()
> Error() vs logError()
>
> Its only three extra characters and they are all in the sweet
> spot on my QWERTY keyboard :o)
>
> I guess my concern would be that if you want to use camelCase 
> and
> start with a lower case letter, there are not a tonne of 
> options.

One other advantage of this naming convention is that when the
plain logging fuctions are used:

Critical("I don't like your naming convention!");

vs.

logCritical("Yeah, well yours isn't any better.");

It is a bit more obvious in the 2nd case what is happening (IMO
anyway, or imoAnyway).


More information about the Digitalmars-d mailing list