Review of Jose Armando Garcia Sancio's std.log

Steven Schveighoffer schveiguy at yahoo.com
Mon Mar 5 15:51:29 PST 2012


On Mon, 05 Mar 2012 18:30:03 -0500, David Nadlinger <see at klickverbot.at>  
wrote:

> On Monday, 5 March 2012 at 21:55:08 UTC, Steven Schveighoffer wrote:
>> The log aliases use names that are too common.  I think log.info is a  
>> better symbol for logging than just 'info', which could be a symbol in  
>> a myriad of places.  Given that D's symbol lookup rules allow shadowing  
>> of global symbols, this does not work out very well.
>
> Originally, the code used log!info and so on, but it was changed to the  
> current design right after review begin, the rationale being that you  
> could always use »import log = std.log« if you want the extra namespace.

That doesn't help.  Software isn't static.

import std.log;
import other; // defines B

class A : B
{
    void foo()
    {
       info("some info message"); // error! int isn't a function!
    }
}

other.d:

class B
{
    int info; // added later
}

>
>> Like others have stated, I think vlog is a) confusing, and b)  
>> unnecessary.  Even reading the docs, I can't understand what it's used  
>> for, and why it has such different syntax than the normal logging stuff.
>
> I think this been modelled after glog's verbose logging support [1],  
> just like much of the rest of the design (by the way, I think a note  
> about this should added somewhere in the module docs). Does the feature  
> as described in the glog docs make sense to you?

It's good to know the root of where this comes from.  The docs in glog do  
make more sense than the vlog docs.

This may be a doc issue.  I'll have to think about it some more.

-Steve


More information about the Digitalmars-d mailing list