Boost logo

Boost Users :

From: Nat Goodspeed (nat_at_[hidden])
Date: 2008-06-13 09:25:54

Mojmir Svoboda wrote:

> run-time configuration like setting
> desired level is ok and already integrated in the first version
> of the library.

Going further out on a limb, and again speaking only for myself, I've
always found that logging "level" doesn't map well to my needs.

I typically need to see full detail for some two or three interacting
subsystems, without any of the log output from any other subsystems.

In homebrew logging systems, I usually associate a string tag with each
log statement. The string tag is looked up on first reaching the
statement, and every subsequent visit tests a cached bool.

When the logging system initializes, it reads config info (from a file
or registry data) to enable/disable particular string tags. I usually
include the ability to express the configuration data as "only these
tags" or "all but these tags."

You can get fancier still by defining relationships between string tags,
expressing them as hierarchies... but I don't consider that essential.

The essence of the idea is the ability to control particular groups of
related log messages. In my experience, the traditional "level" approach
can be restated as:

- hardly any useful information
- not enough useful information
- too much information
- WAY too much information

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at