Merge branch 'feature/ircddblog_#59' into develop fixes #59

develop
Geoffrey Merck 4 months ago
commit 0a5c42bf79

@ -369,7 +369,7 @@ bool CDStarGatewayApp::createThread()
m_thread->setInfoEnabled(true); m_thread->setInfoEnabled(true);
m_thread->setEchoEnabled(true); m_thread->setEchoEnabled(true);
m_thread->setDTMFEnabled(true); m_thread->setDTMFEnabled(true);
m_thread->setLog(true); m_thread->setLog(true, log.logIRCDDBTraffic);
return true; return true;
} }

@ -185,6 +185,8 @@ bool CDStarGatewayConfig::loadLog(const CConfig & cfg)
else if(levelStr == "none") m_log.displayLevel = LOG_NONE; else if(levelStr == "none") m_log.displayLevel = LOG_NONE;
} }
ret = cfg.getValue("log", "logIRCDDBTraffic", m_log.logIRCDDBTraffic, false) && ret;
std::string thresholdStr; std::string thresholdStr;
ret = cfg.getValue("log", "repeatthreshold", thresholdStr, "2", {"disabled", "1", "2", "3", "4","5", "6", "7", "8", "9", "10"}) && ret; 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; if(thresholdStr == "disabled") m_log.repeatThreshold = 0;

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

@ -96,6 +96,7 @@ m_infoEnabled(true),
m_echoEnabled(true), m_echoEnabled(true),
m_dtmfEnabled(true), m_dtmfEnabled(true),
m_logEnabled(false), m_logEnabled(false),
m_logIRCDDB(false),
m_ddModeEnabled(false), m_ddModeEnabled(false),
m_lastStatus(IS_DISABLED), m_lastStatus(IS_DISABLED),
m_statusTimer1(1000U, 1U), // 1 second m_statusTimer1(1000U, 1U), // 1 second
@ -633,9 +634,10 @@ void CDStarGatewayThread::setCCS(bool enabled, const std::string& host)
} }
#endif #endif
void CDStarGatewayThread::setLog(bool enabled) void CDStarGatewayThread::setLog(bool enabled, bool logIRCDDBTraffic)
{ {
m_logEnabled = enabled; m_logEnabled = enabled;
m_logIRCDDB = logIRCDDBTraffic;
} }
void CDStarGatewayThread::setAPRSWriters(CAPRSHandler* outgoingWriter, CAPRSHandler* incomingWriter) void CDStarGatewayThread::setAPRSWriters(CAPRSHandler* outgoingWriter, CAPRSHandler* incomingWriter)
@ -746,11 +748,13 @@ void CDStarGatewayThread::processIrcDDB()
if (!res) if (!res)
break; break;
if (!address.empty()) { if(m_logIRCDDB) {
CLog::logDebug("USER: %s %s %s %s", user.c_str(), repeater.c_str(), gateway.c_str(), address.c_str()); if (!address.empty()) {
CLog::logInfo("USER: %s %s %s %s", user.c_str(), repeater.c_str(), gateway.c_str(), address.c_str());
m_cache.updateUser(user, repeater, gateway, address, timestamp, DP_DEXTRA, false, false); m_cache.updateUser(user, repeater, gateway, address, timestamp, DP_DEXTRA, false, false);
} else { } else {
CLog::logDebug("USER: %s NOT FOUND", user.c_str()); CLog::logInfo("USER: %s NOT FOUND", user.c_str());
}
} }
} }
break; break;
@ -762,11 +766,13 @@ void CDStarGatewayThread::processIrcDDB()
break; break;
CRepeaterHandler::resolveRepeater(repeater, gateway, address, DP_DEXTRA); CRepeaterHandler::resolveRepeater(repeater, gateway, address, DP_DEXTRA);
if (!address.empty()) { if(m_logIRCDDB) {
CLog::logDebug("REPEATER: %s %s %s", repeater.c_str(), gateway.c_str(), address.c_str()); if (!address.empty()) {
m_cache.updateRepeater(repeater, gateway, address, DP_DEXTRA, false, false); CLog::logInfo("REPEATER: %s %s %s", repeater.c_str(), gateway.c_str(), address.c_str());
} else { m_cache.updateRepeater(repeater, gateway, address, DP_DEXTRA, false, false);
CLog::logDebug("REPEATER: %s NOT FOUND", repeater.c_str()); } else {
CLog::logInfo("REPEATER: %s NOT FOUND", repeater.c_str());
}
} }
} }
break; break;
@ -779,11 +785,14 @@ void CDStarGatewayThread::processIrcDDB()
CDExtraHandler::gatewayUpdate(gateway, address); CDExtraHandler::gatewayUpdate(gateway, address);
CDPlusHandler::gatewayUpdate(gateway, address); CDPlusHandler::gatewayUpdate(gateway, address);
if (!address.empty()) {
CLog::logDebug("GATEWAY: %s %s", gateway.c_str(), address.c_str()); if(m_logIRCDDB) {
m_cache.updateGateway(gateway, address, DP_DEXTRA, false, false); if (!address.empty()) {
} else { CLog::logInfo("GATEWAY: %s %s", gateway.c_str(), address.c_str());
CLog::logDebug("GATEWAY: %s NOT FOUND", gateway.c_str()); m_cache.updateGateway(gateway, address, DP_DEXTRA, false, false);
} else {
CLog::logInfo("GATEWAY: %s NOT FOUND", gateway.c_str());
}
} }
} }
break; break;

@ -65,7 +65,7 @@ public:
#ifdef USE_CCS #ifdef USE_CCS
virtual void setCCS(bool enabled, const std::string& host); virtual void setCCS(bool enabled, const std::string& host);
#endif #endif
virtual void setLog(bool enabled); virtual void setLog(bool enabled, bool logIRCDDBTraffic);
virtual void setAPRSWriters(CAPRSHandler* outgoingAprsWriter, CAPRSHandler* incomingAPRSHandler); virtual void setAPRSWriters(CAPRSHandler* outgoingAprsWriter, CAPRSHandler* incomingAPRSHandler);
virtual void setInfoEnabled(bool enabled); virtual void setInfoEnabled(bool enabled);
virtual void setEchoEnabled(bool enabled); virtual void setEchoEnabled(bool enabled);
@ -118,6 +118,7 @@ private:
bool m_echoEnabled; bool m_echoEnabled;
bool m_dtmfEnabled; bool m_dtmfEnabled;
bool m_logEnabled; bool m_logEnabled;
bool m_logIRCDDB;
bool m_ddModeEnabled; bool m_ddModeEnabled;
IRCDDB_STATUS m_lastStatus; IRCDDB_STATUS m_lastStatus;
CTimer m_statusTimer1; CTimer m_statusTimer1;

@ -153,6 +153,7 @@ 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. repeatThreshold=#defaults to 2, valid values are disbaled and 1 to 10. Prevents flooding of logs from repeated log messages.
logIRCDDBTraffic=#Set to true to output ircddb traffic to the log, defaults to false
[Paths] [Paths]
data=/usr/local/share/dstargateway.d/ # Path where the data (audio files etc) can be found data=/usr/local/share/dstargateway.d/ # Path where the data (audio files etc) can be found

@ -158,6 +158,7 @@ The testing framwework used is Google Test.
# 6. Version History # 6. Version History
## 6.1. Version 1.0 ## 6.1. Version 1.0
- [**Improvement**] Add Add an option to disable logging of ircddb traffic ([#59](https://github.com/F4FXL/DStarGateway/issues/59))
- [**Bugfix**] Fix repeater not reverting to startup reflector after issueing a command through remote control. ([#57](https://github.com/F4FXL/DStarGateway/issues/57)) - [**Bugfix**] Fix repeater not reverting to startup reflector after issueing a command through remote control. ([#57](https://github.com/F4FXL/DStarGateway/issues/57))
- [**Bugfix**] Fix corrupted slow data leading to DV Text Message not being sent to ircddb. Thanks to Manfred DL1JM for all the testing. ([#55](https://github.com/F4FXL/DStarGateway/issues/55)) - [**Bugfix**] Fix corrupted slow data leading to DV Text Message not being sent to ircddb. Thanks to Manfred DL1JM for all the testing. ([#55](https://github.com/F4FXL/DStarGateway/issues/55))
- [**Improvement**] Add version info to output of --version ([#56](https://github.com/F4FXL/DStarGateway/issues/56)) - [**Improvement**] Add version info to output of --version ([#56](https://github.com/F4FXL/DStarGateway/issues/56))

Loading…
Cancel
Save

Powered by TurnKey Linux.