Early review of std.logger

Martin Drasar drasar at ics.muni.cz
Mon Oct 14 07:11:50 PDT 2013


On 14.10.2013 15:43, Robert Schadek wrote:
> On 10/14/2013 03:31 PM, Martin Drasar wrote:
> Yes, but you have to lookup the formatting parameter, which adds some
> complexity. It would also a time complexity for each logging call,
> because you would have to parse the format. IMO KISS.

Ok, let's have it simple.

>> This was tightly coupled with the previous request, i.e. not using
>> string format and logging one string, but passing several strings and
>> let the target logger assemble them as it see fit.
> This plays in my hands exactly, you have properly some idea of "see fit"
> and I can't anticipate this and properly can't create such a flexible
> configuration that makes it all see fit. So write you're own logger and
> handle all strings our own. Just ignore the printf style formatted
> string at the beginning or just call logf("", string1, string2, ...) and
> mix string1 and friend as you see fit ;-)

Yup, you are right. I somehow overlooked that these logf functions are
best suited for what I want.

>> How about being able to log only certain log level(s) and not only
>> greater or equal?
>>
>> Martin
> Well, Bitmasked come to mind, but I really don't want to go C-Style and
> I think that defeats the purpose of having levels.

I am not sure how that defeats the purpose, but one way to go around
this is to have the logger log also the logLevel of each message and
then grep for what you need. What do you say about adding this
functionality?

Martin


More information about the Digitalmars-d mailing list