Boost logo

Boost :

From: Hoeffner, Detlef (Detlef.Hoeffner_at_[hidden])
Date: 2002-04-11 11:56:47


My suggestion is to use streambuf's as the interface to all kind of
(logging) sinks since this is what they are made for. I even consider
it as a mistake not use streambuf's for that purpose.

streambuf's provide for what you want, e.g. you can use them in a
non bufferuing mode.

This is the first step. The second step is to use a factory for
streambuf's that creates streambufs for different kind of
io-interfaces, e.g. tcp/ip, files, memory, ... from an URL.

This together is a reusable abstraction of io-interfaces that might be
used for other cases too, e.g. for communication between processes.

Regards

Detlef

-----Original Message-----
From: Andras Erdei [mailto:ccg_at_[hidden]]
Sent: Donnerstag, 11. April 2002 17:25
To: boost_at_[hidden]
Subject: Re: [boost] Logging library - Organization of effort

On Thu, 11 Apr 2002 14:39:32 +0200, "Hoeffner, Detlef"
<Detlef.Hoeffner_at_[hidden]> wrote:

>> I would like to keep as simple and primitive as possible
>> for performance reasons, but there can be a separate interface
>> for this kind of general usage, if there really is a
>> demand.

>From my viewpoint this seems to be a very simple as well as very reusable
>design since it provides a hight integration in the std iostream library.
>Why do you believe it is not simple?

At the sink level there should be no buffering (e.g. my file
sink flushes the content at every write, so in case of a crash
you can see where it actually went haywire, modulo OS caching
and heavy crahes), and the same sinks should be usable in release
code. In release mode only the memory sink is active, and is does
a simple memcpy() (modulo circular buffer), and the logging is
restricted to single char *s. This means that the sinks only accept
char *s -- in release mode those come from the string buffers
.str().c_str().

OTOH i might be misunderstand what you are proposing.
Can you elaborate a bit ?

TIA
andras

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


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