Implementing std.log

Jacob Carlborg doob at me.com
Sun May 15 12:54:00 PDT 2011


On 2011-05-14 19:04, Andrei Alexandrescu wrote:
> On 5/9/11 1:52 AM, Andrei Alexandrescu wrote:
> [snip]
>
> I updated my std.log draft. Added a lot of features including formatted
> writing, delayed logging, and a variety of configuration options.
> Replaced the redundant log.xyz with logXyz. The implementation is
> getting close to reviewable form.
>
> Documentation:
>
> http://d-programming-language.org/phobos-prerelease/std_log.html
>
> Source:
>
> https://github.com/andralex/phobos
>
> Feedback welcome.
>
>
> Thanks,
>
> Andrei

How about an API that looks something like this: 
http://pastebin.com/dLVp1GRr

This API contains standard interfaces for a logger and a logging level. 
It contains a default logger implementation and a couple of logging 
levels. This API also allows you to implement custom loggers and custom 
logging levels. Multiple logger instances are possible with options set 
on each instance.

Note this is just a suggestion for the API and doesn't contain any real 
implementation (just prints to stdout).

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list