fixed weird flushing (#95)

This commit is contained in:
john30
2017-06-24 07:00:44 +02:00
parent e451e96a90
commit 77b018b500
2 changed files with 14 additions and 6 deletions
+6 -2
View File
@@ -45,7 +45,8 @@ class RotateFile {
* @param textMode whether to write each byte with prefixed timestamp and direction as text.
*/
RotateFile(const string fileName, const unsigned int maxSize, const bool textMode = false)
: m_enabled(false), m_fileName(fileName), m_maxSize(maxSize), m_textMode(textMode), m_stream(), m_fileSize(0) {}
: m_enabled(false), m_fileName(fileName), m_maxSize(maxSize), m_textMode(textMode), m_stream(), m_fileSize(0),
m_flushSize(0) {}
/**
* Destructor.
@@ -92,8 +93,11 @@ class RotateFile {
/** the @a FILE to writing to. */
FILE* m_stream;
/** the number of bytes already written to the @a m_file. */
/** the number of bytes written to @a m_file. */
uint64_t m_fileSize;
/** the number of bytes written to @a m_file since the last flush. */
uint64_t m_flushSize;
};
} // namespace ebusd