Add repeat thrshold to log configuration #44

develop
Geoffrey Merck 2 years ago
parent dea92a2076
commit b69c0e5fcb

@ -181,6 +181,11 @@ bool CDStarGatewayConfig::loadLog(const CConfig & cfg)
else if(levelStr == "none") m_log.displayLevel = LOG_NONE; else if(levelStr == "none") m_log.displayLevel = LOG_NONE;
} }
std::string thresholdStr;
ret = cfg.getValue("log", "repeatthreshold", thresholdStr, "2", {"disabled", "1", "2", "3", "4","5", "6", "7", "8", "9", "10"}) && ret;
if(thresholdStr == "disabled") m_log.repeatThreshold = 0;
else m_log.repeatThreshold = ::atoi(thresholdStr.c_str());
return ret; return ret;
} }

@ -88,6 +88,7 @@ typedef struct {
LOG_SEVERITY fileLevel; LOG_SEVERITY fileLevel;
std::string fileRoot; std::string fileRoot;
bool fileRotate; bool fileRotate;
uint repeatThreshold;
} TLog; } TLog;
typedef struct { typedef struct {

@ -152,6 +152,7 @@ fileRoot= # defaults to dstarGateway
fileRotate= # rotate log files daily, defaults to true fileRotate= # rotate log files daily, defaults to true
fileLevel= # defaults to info, valid values are trace, debug, info, warning, error, fatal, none fileLevel= # defaults to info, valid values are trace, debug, info, warning, error, fatal, none
displayLevel= # defaults to info, valid values are trace, debug, info, warning, error, fatal, none displayLevel= # defaults to info, valid values are trace, debug, info, warning, error, fatal, none
repeatThreshold=#defaults to 2, valid values are disbaled and 1 to 10. Prevents flooding of logs from repeated log messages.
[Paths] [Paths]
data=/usr/local/share/dstargateway.d/ #Path where the data (hostfiles, audio files etc) can be found data=/usr/local/share/dstargateway.d/ #Path where the data (hostfiles, audio files etc) can be found

Loading…
Cancel
Save

Powered by TurnKey Linux.