From 3dde4250ae27629bc4a633bc76472ac8519201ef Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Wed, 7 Oct 2015 17:37:04 +0200 Subject: [PATCH] Disable logs general override configuration, for system test easy startup --- example/diameter/launcher/Launcher.cpp | 27 +++++++++++++++++--------- example/diameter/launcher/main.cpp | 1 + 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index 5ee3466..c582cf4 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -132,7 +132,11 @@ Launcher::Launcher() : anna::comm::Application("launcher", "DiameterLauncher", " void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool eventOperation) throw(anna::RuntimeException) { - // + + CommandLine& cl(anna::CommandLine::instantiate()); + bool allLogsDisabled = cl.exists("disableLogs"); + + // const anna::xml::Attribute *id, *dictionary; // @@ -140,7 +144,6 @@ void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool eventOp *answersTimeout, *ceaTimeout, *watchdogPeriod, *entity, *entityServerSessions, *diameterServer, *diameterServerSessions, *balance, *sessionBasedModelsClientSocketSelection, *retries, *log, *splitLog, *detailedLog, *dumpLog, *burstLog; - // Never clear services content from here (append new data from xml). At the moment no node removing is implemented in this process // Stacks @@ -348,13 +351,15 @@ void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool eventOp } // Logs: - std::string realm = commEngine->getRealm(); - std::string s_log = realm + ".launcher.log"; if (log) s_log = log->getValue(); - bool b_splitLog = (splitLog ? (splitLog->getValue() == "yes") : false); - bool b_detailedLog = (detailedLog ? (detailedLog->getValue() == "yes") : false); - bool b_dumpLog = (dumpLog ? (dumpLog->getValue() == "yes") : false); - std::string s_burstLog = realm + ".launcher.burst"; if (burstLog) s_burstLog = burstLog->getValue(); - a_workingNode->setLogs(s_log, b_splitLog, b_detailedLog, b_dumpLog, s_burstLog); + if (!allLogsDisabled) { + std::string realm = commEngine->getRealm(); + std::string s_log = realm + ".launcher.log"; if (log) s_log = log->getValue(); + bool b_splitLog = (splitLog ? (splitLog->getValue() == "yes") : false); + bool b_detailedLog = (detailedLog ? (detailedLog->getValue() == "yes") : false); + bool b_dumpLog = (dumpLog ? (dumpLog->getValue() == "yes") : false); + std::string s_burstLog = realm + ".launcher.burst"; if (burstLog) s_burstLog = burstLog->getValue(); + a_workingNode->setLogs(s_log, b_splitLog, b_detailedLog, b_dumpLog, s_burstLog); + } // Lazy initialization for comm engine: @@ -967,6 +972,10 @@ std::string Launcher::help() const throw() { result += "\n to load new nodes once the ADML is started, regardless if command"; result += "\n line '--services' parameter was used or not. Those services which"; result += "\n are not correctly loaded will be ignored to keep the process alive."; + result += "\n If you need to load services as deltas, you must firstly load the"; + result += "\n diameter base dictionary with stack id 0, because all the realms"; + result += "\n will use this dictionary to encode/decode base protocol messages"; + result += "\n managed by the communication engine."; result += "\n"; result += "\ndiameterServerSessions| Updates the maximum number of accepted connections to diameter"; result += "\n server socket."; diff --git a/example/diameter/launcher/main.cpp b/example/diameter/launcher/main.cpp index a0f4fb6..9f45651 100644 --- a/example/diameter/launcher/main.cpp +++ b/example/diameter/launcher/main.cpp @@ -35,6 +35,7 @@ int main(int argc, const char** argv) { commandLine.add("tmDir", anna::CommandLine::Argument::Optional, "Test manager directory. By default is the current execution directory. Warning: report files could be dump during system testing (see help for management operation 'test|report'); take care about the possible accumulation of files"); commandLine.add("cntRecordPeriod", anna::CommandLine::Argument::Optional, "Counters record procedure period in milliseconds. If missing, default value of 300000 (5 minutes) will be assigned. Value of 0 disables the record procedure."); commandLine.add("logStatisticSamples", anna::CommandLine::Argument::Optional, "Log statistics samples for the provided concept id list, over './sample..csv' files. For example: \"1,2\" will log concepts 1 and 2. Reserved word \"all\" activates all registered statistics concept identifiers. That ids are shown at context dump (see help to get it)."); + commandLine.add("disableLogs", anna::CommandLine::Argument::Optional, "Overrides every realm configuration regarding traffic log in order to disable it and ease production or system test startup.", false); // Communications commandLine.add("reconnectionPeriod", anna::CommandLine::Argument::Optional, "Milliseconds to recover diameter client-session when server connection has been broken. If missing, default value of 10000 will be assigned"); -- 2.20.1