|
Boost : |
From: John Torjo (john.lists_at_[hidden])
Date: 2005-04-26 15:02:25
Jody Hagins wrote:
> On Tue, 26 Apr 2005 12:16:03 -0400
> Caleb Epstein <caleb.epstein_at_[hidden]> wrote:
>
>
>
>>I think John's approach to having multiple log "levels" is to just use
>>a separate log for each one (e.g. you might have logs called trace,
>>debug, warning, info, and fatal). Logs are either enabled or
>>disabled; there is no "level" or above-some-threshold-type checking as
>>with some other common implementations.
>
>
>
> Unfortunately, you lose relativity in logs, which is very important in
> diagnosing failures. Suppose a problem occurs that gets logged to the
I'm not sure we're talking about the same thing. If you have not read
the docs, I'd suggest you do.
Note that right here, we're talking about a logical log. You can specify
this log's destination(s) and/or modifiers (that is, prepend time,
thread ID, append an enter if not already there, etc.) And, you can
enable/disable logs.
BOOST_LOG(app) << "testing " << i << '-' << j;
If you wish, you can have all your logs write to the same file. Or,
certain logs can even write to multiple locations. For example, my "dbg"
logs always writes to a file, and to the Debug Output Window.
As for "However, this restricts the application to one single logging
status", I'm not sure I understand.
Based on, lets say, command-line parameters, you can choose to
enable/disable any logs you like.
Best,
John
-- John Torjo, Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -v1.6.3 (Resource Splitter) -- http://www.torjo.com/cb/ - Click, Build, Run!
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk