Implementing std.log

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 9 12:10:02 PDT 2011


On 5/9/11 1:33 PM, Robert Clipsham wrote:
> On 09/05/2011 19:30, Robert Clipsham wrote:
>> The example looks great, exactly what I'd hope for in the way of a
>> logging library. A few questions:
>>
>> * How do you disable logging at compile time? (and is it zero overhead?)
>> * How do you define your own logging backend?
>> * Is it possible to change logging options after initialisation?
>>
>> There are a couple of features missing, but you seem to have mentioned
>> planning to implement these elsewhere in the thread. Once they're in
>> place I'd be happy to vote yes to its inclusion into phobos.
>
> One more question:
>
> * Can you log using formatting, or do you have to wrap the call in a
> call to format()? eg.
> ----
> log.info("My %s string %s", "format", 3);
> ----

I thought I'd leave that to format(), but probably it's worth just 
putting the feature in std.log too. One nice thing about supporting 
format directly is that often there's no need to allocate memory while 
logging.

Andrei



More information about the Digitalmars-d mailing list