Implementing std.log

Jacob Carlborg doob at me.com
Sun May 15 08:15:38 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

Why does the user have to manually initialize the library? Why not use a 
static constructor or lazy initialization?

Actually I don't like it at all, that  the logging library is configured 
via command line options. Seems very odd to me in the first place. That 
is something that should be handled by the application that uses std.log 
not the library itself. The library should be configurable via regular 
methods, like "log.verbose = true". You could provide a shortcut that 
configures the library via the command line but that should be optional 
and not the default.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list