Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2004-11-01 14:01:07

>>You can write a specialisation of log_manager<0> and include this before
>>log.hpp to replace these types.
>>The "stream" type needs to have a str() member function to convet it to
>>the "string" type. In an (unreleased) version this was avoided by having a
>>separate to_string function as part of the manager policy - it might end up
>>that way again?

I guess we can add that back... If it's important, certainly.
>>Of course at most of the supplied appender and modifier functions will not work
>>with a wildly different "string" type, although the simple write_to_file
>>function should work with anything with a reasonable operator<< defined.
> Having the interface string-based makes things easy in the general case; such as when


> adding modifiers (prependers? Sorry, I'm in no way friendly with the naming of the concepts yet).

sorry. I'm open to suggestions...

> However it makes things extremely difficult for integration with structured log facilities.
I'd really, really not like to use iostreams, sscanf or regex to extract
information out of the
string at the back-end, converting into correct data types etc ... ;-)

Could you be a little more specific?
As Darryl said, you can change the log manager.

Sorry there's no docs yet - but I should get back to work on it in about
  2-3 weeks, and add docs, refine concept, etc.

> I do kind of like the current implementation's interface, but I'd prefer a
structured internal format with possibilities to a stream-based interface.
But again, that's just my 0.02EUR.

I donot unerstand. You just said something else above...

> BTW, is a single ts_appender instance meant to be used by multiple threads?
In that case the code inside ts_appender::operator() is not thread-safe ...
wait a minute .. just saw that there was another lock inside
Still feels like checking the same thing twice (at least).

Sorry for that - I just added one more FIXME ;)


John Torjo,    Contributing editor, C/C++ Users Journal
-- "Win32 GUI Generics" -- generics & GUI do mix, after all
-- 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, gregod at, cpdaniel at, john at