|
Boost : |
Subject: Re: [boost] [log] Review-ready version in the Vault
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2009-02-14 10:34:47
Alexander Arhipenko wrote:
> 1 (minor): annoying warnings like
> 'class aaa has virtual functions but non-virtual destructor' with kilobytes of
> related messages ('in instantiation of bla-bla ... instantiated from here' etc)
Yes, these warnings were reported by others, too. I've fixed them (at
least, I hope so) in CVS HEAD.
> 2 (major): rotating_ofstream seems not working correctly
> when std::ios_base::app flag passed to rotating_ofstream ctor (or open
> function).
> In case of using that flag no file is created.
> That's because in rotating_ofstream.hpp,
> file_controller_base ctor m_OpenMode is generated as:
>
> m_OpenMode |= std::ios_base::out | std::ios_base::trunc;
> m_OpenMode &= ~std::ios_base::in;
>
> ios_base::trunc and ios_base::app flags are "conflicting"
> (at least in my stdcxx). So, the file is not opened.
True. I forgot about the "app" flag, indeed. However, what behavior were
you trying to achieve with this flag? It doesn't occur to me that it has
much sense with the rotating stream.
> I've also noticed that rotation is working only for one program run
> (even if ios_base::app open mode is used).
> I.e., I have application with static output to log. At first run 4 log
> files are created. At second run log file count is the same - 4.
> In my expectation, it should be 8.
> (By the way, python logging module generates 8 files for the
> same scenario if using logging.handlers.RotatingFileHandler).
I see. I guess the problem is that the stream does not scan the output
directory for other files. I'll try to fix that.
> Also, I have minor feature request related to rotating file naming.
> I will be nice to have current active log file name as: 'file.log'.
> And the others as file.log.1, file.log.2 etc
> (i.e., name pattern is not applied to active log file).
Looks like the rotation functionality needs to be extended quite
considerably, as I have received other requests for different rotation
schemes. I'll have to think about how to implement this extension better.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk