refactor: remove Unneed enum for LogOutputters and use a constexp instead
This commit is contained in:
parent
3ececbcfd9
commit
fe3c41f857
1 changed files with 2 additions and 5 deletions
|
|
@ -14,10 +14,7 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
enum EFileLogOutputter
|
constexpr auto s_logFileSizeLimit = 1024 * 1024; //!< Max Log size before rotating (1Mb)
|
||||||
{
|
|
||||||
kFileSizeLimit = 1024 // kb
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// StopLogOutputter
|
// StopLogOutputter
|
||||||
|
|
@ -154,7 +151,7 @@ bool FileLogOutputter::write(LogLevel level, const char *message)
|
||||||
|
|
||||||
// when file size exceeds limits, move to 'old log' filename.
|
// when file size exceeds limits, move to 'old log' filename.
|
||||||
size_t p = m_handle.tellp();
|
size_t p = m_handle.tellp();
|
||||||
if (p > (kFileSizeLimit * 1024)) {
|
if (p > s_logFileSizeLimit) {
|
||||||
moveFile = true;
|
moveFile = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue