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

@@ -88,6 +88,16 @@ class Foundation_API SimpleFileChannel: public Channel
///
/// If no secondary path is specified, the secondary path will
/// default to <primaryPath>.1.
///
/// 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.
///
{
public:
SimpleFileChannel();
@@ -113,6 +123,9 @@ public:
/// * secondaryPath: The secondary log file's path.
/// * rotation: The log file's rotation mode. See the
/// SimpleFileChannel class for details.
/// * flush: Specifies whether messages are immediately
/// flushed to the log file. See the SimpleFileChannel
/// class for details.
std::string getProperty(const std::string& name) const;
/// Returns the value of the property with the given name.
@@ -134,10 +147,12 @@ public:
static const std::string PROP_PATH;
static const std::string PROP_SECONDARYPATH;
static const std::string PROP_ROTATION;
static const std::string PROP_FLUSH;
protected:
~SimpleFileChannel();
void setRotation(const std::string& rotation);
void setFlush(const std::string& flush);
void rotate();
private:
@@ -145,6 +160,7 @@ private:
std::string _secondaryPath;
std::string _rotation;
UInt64 _limit;
bool _flush;
LogFile* _pFile;
FastMutex _mutex;
};