RE: [boost] Circular log buffer

Hi Darren,
From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] 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

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).
Indeed - I want to add cyclic logs (or rotating, if you wish) to the logging lib - in the very near future. Still, Darren, I think it should be pretty easy do do such a class yourself - I assume it should not be too difficult. 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
participants (2)
-
Ferdinand Prantl
-
John Torjo