Using glog's design for Phobos?

Lutger lutger.blijdestijn at gmail.com
Fri Aug 27 00:09:15 PDT 2010


Walter Bright wrote:

> Andrei Alexandrescu wrote:
>> At my workplace we're using Google's logging library glog
>> (http://google-glog.googlecode.com/svn/trunk/doc/glog.html), and the
>> more I use it, the more I like it. It's simple, to the point, and
>> effective.
>> 
>> I was thinking it would be great to adapt a similar design into Phobos.
>> There will be differences such as use of regular argument lists instead
>> of << etc., but the spirit will be similar. What do you think?
> 
> Ok, I'm going to get flamed for this, but,
> 
>      I don't get it
> 
> I do logging all the time. It's usually customized to the particular problem
> I'm trying to solve, so it involves uncommenting the right printf's and then
> running it. Voila. Done.

One crucial step you require here is recompilation: that's not always an option. 
 
> The logging libraries I've seen usually required more time spent installing
> the package, getting it to compile, reading the documentation, finding out it
> doesn't work, rereading the documentation, etc., etc., than just putting in a
> #@$%^ printf, and Bang, it works, cut & print.

imho a logging library should have log(msg) as a base case that just works. On 
the other hand, if your requirements do not go beyond printf then it is only 
natural any investment feel somewhat pointless.
 
> Even worse, the logging libraries are loaded with a grab bag of trivial
> features to try and puff it up into looking impressive. They always seemed to
> me to be a solution in search of a problem.
> 
> Shields up! what am I missing about this?

I think there are two basic requirements that logging libraries fulfill:
- tuning the amount of info that is logged dynamically (no recompilation) 
- getting good log reports (rotating logs, nicely structured output, etc.)

If you don't need this, then a log library does not give that much value. 



More information about the Digitalmars-d mailing list