Boost logo

Boost :

From: Ferdinand Prantl (ferdipr_at_[hidden])
Date: 2004-10-28 06:07:22


Hi Darren,

> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Darren Cook
>
> I'm finding an increasing need for an in-file memory log:
> specifically when my program asserts I want to see where it has been.
>
> There are two problems with normal logging, i.e. appending to
> a disk file:
> * The files get very, very big (I've filled my home
> partition before)
> * All that writing to disk slows the application down noticeably.

Usually you have to suffer the pain of the disk-writes because
you need the log-file to analyze the reason of some crash and
then the unflushed memory buffer to loose would not help much...

The problem of disk space is normally solved by log rotating
(parameters line maxlogfilesize and maxlogfilecount of a
 usual logging framework).

If the logging causes unacceptable delays and is still required
and cannot be moved to other parts of code with more details,
I could imagine logging into a shared memory and a separate
logging process flushing this memory to disk.

I have not seen an ostream-like implementation for this, however.
But circular buffer should be somewhere in the boost-sandbox.

Ferda


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