Boost logo

Boost :

From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2004-11-17 10:54:53


On Wed, 17 Nov 2004 10:02:10 +0200, Stefan Shishkov <stefan_at_[hidden]> wrote:
> I noticed that file_appender is a base class in a hierarchy with virtual
> functions but without a virtual destructor. Is this OK?.

Thanks for the extra eyes. This was just an oversight.

I've now split this code into separate headers:

* appenders.hpp is a convenience header that includes the next three headers.
* file_appender.hpp defines logfile and the basic file_appender. No
dependencies other than boost::log.
* rolling_file_appender.hpp defines rolling_file_appender which rolls
over files when they exceed a maximum size and keeps a maximum number
of backups. Depends on boost::filesystem.
* periodic_file_appender.hpp defines periodic_file_appender, which
behaves like rolling_file_appender but uses a time interval and not
file size to determine when the logfile should be rolled-over. It
does not implement any policy in terms of numbers of files. It could
perhaps be called "periodic_rolling_file_appender" but that name seems
obnoxiously long. There are also some convenience functions for
creating periodic_file_appender objects with commonly used frequencies
(hour, day, week, month and year). No dependencies other than
boost::log.
* filename_factory.hpp defines filename_factory_strftime method (name
change). No dependencies other than boost::log.

I'm not sure the "filename factory" function and this last header
really belong in the boost::log namespace. It is just a simple
transformation on a string and can probably be templated on the string
type. Where would be the right place for something like this (it
needs to be accessible to callers, so a nested detail namespace is not
appropriate)? Perhaps boost::utility?

-- 
Caleb Epstein
caleb dot epstein at gmail dot com











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