diff --git a/DStarGateway/DStarGatewayConfig.cpp b/DStarGateway/DStarGatewayConfig.cpp index 15b2028..da334be 100644 --- a/DStarGateway/DStarGatewayConfig.cpp +++ b/DStarGateway/DStarGatewayConfig.cpp @@ -181,6 +181,11 @@ bool CDStarGatewayConfig::loadLog(const CConfig & cfg) 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; } diff --git a/DStarGateway/DStarGatewayConfig.h b/DStarGateway/DStarGatewayConfig.h index d148987..1a15d65 100644 --- a/DStarGateway/DStarGatewayConfig.h +++ b/DStarGateway/DStarGatewayConfig.h @@ -88,6 +88,7 @@ typedef struct { LOG_SEVERITY fileLevel; std::string fileRoot; bool fileRotate; + uint repeatThreshold; } TLog; typedef struct { diff --git a/DStarGateway/example.cfg b/DStarGateway/example.cfg index 731da4e..73d7b09 100644 --- a/DStarGateway/example.cfg +++ b/DStarGateway/example.cfg @@ -152,6 +152,7 @@ fileRoot= # defaults to dstarGateway fileRotate= # rotate log files daily, defaults to true 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 +repeatThreshold=#defaults to 2, valid values are disbaled and 1 to 10. Prevents flooding of logs from repeated log messages. [Paths] data=/usr/local/share/dstargateway.d/ #Path where the data (hostfiles, audio files etc) can be found