Add optional log rotation and fix a UDP bug.

This commit is contained in:
Jonathan Naylor
2020-11-01 12:54:51 +00:00
parent 9e4587c1d3
commit 83a929c2b4
18 changed files with 134 additions and 16 deletions
+8
View File
@@ -43,6 +43,7 @@ m_logDisplayLevel(0U),
m_logFileLevel(0U),
m_logFilePath(),
m_logFileRoot(),
m_logFileRotate(true),
m_networkPort(0U),
m_networkDebug(false)
{
@@ -124,6 +125,8 @@ bool CConf::read()
m_logFileLevel = (unsigned int)::atoi(value);
else if (::strcmp(key, "DisplayLevel") == 0)
m_logDisplayLevel = (unsigned int)::atoi(value);
else if (::strcmp(key, "FileRotate") == 0)
m_logFileRotate = ::atoi(value) == 1;
} else if (section == SECTION_NETWORK) {
if (::strcmp(key, "Port") == 0)
m_networkPort = (unsigned int)::atoi(value);
@@ -172,6 +175,11 @@ std::string CConf::getLogFileRoot() const
return m_logFileRoot;
}
bool CConf::getLogFileRotate() const
{
return m_logFileRotate;
}
unsigned int CConf::getNetworkPort() const
{
return m_networkPort;