Boost logo

Boost :

From: Eelis van der Weegen (gmane_at_[hidden])
Date: 2005-11-12 15:28:55


I have a couple of design questions:

1. What is the fundamental reason that logs cannot be declared/defined with
something as simple as boost::logging::log mylog ("mylog"); ? What
special needs do you have that rule out this approach? (I took a brief look
at the source code, got a vague idea what you were trying to accomplish,
and have some ideas about how the same may be accomplished without
resorting to macro's, but would like to hear your explanation and reasoning
first.)

2. I am very skeptical about logs having both a C++ identifier and a string
name. The documentation argues that the string names bring "extreme
flexibility" in the following two ways:

a: External identification

While I agree that external identification may sometimes be useful to some
users, is it really necessary to integrate it into the library? Would the
users who require such functionality not be able to simply use something
like a std::map<std::string, log *> ?

b: Log hierarchies

I do not question the usefulness of log hierarchies, but am not convinced
that string names (and wildcard queries) are the best way to implement them.

It seems to me that all that is needed to be able to form hierarchies of
logs, is a way to express parent->child relationships between two logs.
Indeed, something as simple as parent_log.append_child(child_log); should
suffice.

Wildcarded queries would simply become logs (or some sort of log-proxies)
by themselves, that the user must manually connect to the desired sink logs.

While this approach is slightly more cumbersome, I feel that getting rid of
all the string name cruft is definitely a big win.

What are your feelings about this?

Regards,

Eelis


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk