Boost logo

Boost Users :

From: Mojmir Svoboda (mojmir.svoboda_at_[hidden])
Date: 2008-06-16 09:58:29


* Nat Goodspeed <nat_at_[hidden]> [2008-06-13 09:25:54 -0400]:

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

i'm using another orthogonal filtering facility - context. for example
i want to dump only control messages exchanged between components of the
program.

> 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

could you show me perhaps some of your config files? just for
inspiration...

how do you force reload of config? on unix i'd use a signal, but to be
honest, have no big clue about windows...

> You can get fancier still by defining relationships between string tags,
it' always easier to blob up the design ;)

> 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.

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

i admit you have point there. i was in situations where simple level
was not enough. that's why i planned to add another run-time filtering
facility; for example you could define your facilities like that:

namespace flog {

    unsigned const bit_all = bin<11111111>::value;
    unsigned const bit_trace = bin<00000001>::value;
    unsigned const bit_hedumps = bin<00000010>::value;
    unsigned const bit_dataflow = bin<00000100>::value;
        ...
    unsigned const bit_synchro = bin<10000000>::value;

    /**@class default_filters
     * @brief sequence of default filters used for text formatting
     */
    typedef runtime_flt<context, and_op > rt_context;
    typedef runtime_flt<level, std::less_equal> rt_level;
    typedef mpl::vector<rt_context ,I, rt_level ,I, time ,I,
                        file,chr<':'>,line, I, msg>::type default_filters;

} // namespace flog

..
and then somthing like:

LOG(l, bit_debug, 7, "will enable trace...");
runtime_set(l, identity<rt_context>(), bit_hexdump | bit_trace);
{
   ENTRY(l, 7, "void foo(T) [with T = long int]");
}

i'd really like to know your opinion on that.

best regards,
mojmir


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net