Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2004-10-26 02:18:11


> I think John's approach is minimally intrusive and the usage of
> iostreams makes it pretty much impossible to mess anything up.
>
> I'm sure he can come up with a way that it can be used without macro
> as well (e.g. perhaps a boost::log method). As it stands now, it can
> be done but you'd be stuck with lines like:
>
> *(boost::log::log_id<log_stream_logid_type>::unique_id().m_stream)
> << some_message;
>
> Which is a lot harder to type than BOOST_LOG(log_stream) :-)
>
> I am not a fan of macros, and avoid them where possible, but I think
> they are the least painful solution to a problem like this one.
>

The main reason for requiring a macro was for efficiency, so that
logging statements could easily be disabled.

No matter what, you'll somehow need to do something like:

// equivalent of: BOOST_LOG (some_log) << the << things << to << output;

if ( is_enabled(some_log))
    some_log << the << things << to << output;

Which to me seems tedious and you can easily forget to write that.

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.5 - tooltips at your fingertips (work for menus too!)
    + bitmap buttons (work for MessageBox too!)
    + tab dialogs, hyper links, lite html

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