port from 1.4.4 (rev. 1925 fixed SF# 3483174)

This commit is contained in:
Aleksandar Fabijanic
2012-08-22 03:25:25 +00:00
parent d9cf671330
commit 801b2485f4
13 changed files with 94 additions and 21 deletions

View File

@@ -167,6 +167,15 @@ class Foundation_API FileChannel: public Channel
/// deleted, starting with the oldest. When "none" or empty string are
/// supplied, they reset purgeCount to none (no purging).
///
/// The flush property specifies whether each log message is flushed
/// immediately to the log file (which may hurt application performance,
/// but ensures that everything is in the log in case of a system crash),
// or whether it's allowed to stay in the system's file buffer for some time.
/// Valid values are:
///
/// * true: Every essages is immediately flushed to the log file (default).
/// * false: Messages are not immediately flushed to the log file.
///
/// For a more lightweight file channel class, see SimpleFileChannel.
{
public:
@@ -205,6 +214,9 @@ public:
/// * purgeCount: Maximum number of archived log files before
/// files are purged. See the FileChannel class
/// for details.
/// * flush: Specifies whether messages are immediately
/// flushed to the log file. See the FileChannel class
/// for details.
std::string getProperty(const std::string& name) const;
/// Returns the value of the property with the given name.
@@ -227,6 +239,7 @@ public:
static const std::string PROP_COMPRESS;
static const std::string PROP_PURGEAGE;
static const std::string PROP_PURGECOUNT;
static const std::string PROP_FLUSH;
protected:
~FileChannel();
@@ -235,6 +248,7 @@ protected:
void setCompress(const std::string& compress);
void setPurgeAge(const std::string& age);
void setPurgeCount(const std::string& count);
void setFlush(const std::string& flush);
void purge();
private:
@@ -245,6 +259,7 @@ private:
bool _compress;
std::string _purgeAge;
std::string _purgeCount;
bool _flush;
LogFile* _pFile;
RotateStrategy* _pRotateStrategy;
ArchiveStrategy* _pArchiveStrategy;