Boost logo

Boost :

Subject: Re: [boost] [log] Comments
From: Roland Bock (rbock_at_[hidden])
Date: 2010-03-15 15:07:57


Vladimir Prus wrote:
> First, it seems to me that if two major projects use component/severity scheme,
> then presumably it's of general utility. Second, in the thread you have
> mentioned, you yourself provide example solution that are far from trivial.
> Maybe I'm missing something? In essence, I would like to have:
>
> magic_logger lg;
> DO_MAGIC(lg, "my_component", debug) << "hi there";
>
> Could you show what will it take?
>
We are using component/severity, too. I decided to interpret the channel
as component. Some sample code is attached to my review:

http://lists.boost.org/Archives/boost/2010/03/162902.php

After some preparation in the init function, developers can do the
following:

    src::severity_channel_logger<severity_level> lg1(keywords::channel = "FirstComponent");

    BOOST_LOG_SEV(lg1, trace) << "A trace severity message";
    BOOST_LOG_SEV(lg1, debug) << "A debug severity message";

I plan to hide most of the first line in a typedef and a convenience
function.

> I saw that -- my point is that *default* behaviour should be to go on no
> matter what is wrong.
>
I second that (and, if that were is possible in English, I'd third and
forth that). Logging must not fail until the machine crumbles to dust.

Especially: No message must be lost.

I know that is not really possible, but providing a very high level of
certainty that messages do not get lost is of extreme importance.


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