add option to reduce dump flush buffer size to 1

This commit is contained in:
john30
2020-01-25 15:22:30 +01:00
parent 7b8ceb7db5
commit fb32960402
5 changed files with 15 additions and 4 deletions
+6 -2
View File
@@ -43,10 +43,11 @@ class RotateFile {
* @param fileName the name of the file write to.
* @param maxSize the maximum size of the file to write to.
* @param textMode whether to write each byte with prefixed timestamp and direction as text.
* @param flushBuffer the size of the flush buffer.
*/
RotateFile(const string fileName, const unsigned int maxSize, const bool textMode = false)
RotateFile(const string fileName, const unsigned int maxSize, const bool textMode = false, const unsigned int flushBuffer = 16)
: m_enabled(false), m_fileName(fileName), m_maxSize(maxSize), m_textMode(textMode), m_stream(), m_fileSize(0),
m_flushSize(0) {}
m_flushSize(0), m_flushBuffer(flushBuffer) {}
/**
* Destructor.
@@ -98,6 +99,9 @@ class RotateFile {
/** the number of bytes written to @a m_file since the last flush. */
uint64_t m_flushSize;
/** the size of the flush buffer. */
const unsigned int m_flushBuffer;
};
} // namespace ebusd