From: Eduardo Ramos Testillano Date: Tue, 21 Apr 2015 15:42:31 +0000 (+0200) Subject: Add type of event to dump logs X-Git-Tag: REFACTORING_TESTING_LIBRARY~153 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=48d4097ad5936dfc7df88cc7772333d249beb45b;p=anna.git Add type of event to dump logs --- diff --git a/example/diameter/launcher/main.cpp b/example/diameter/launcher/main.cpp index e761b9f..39b0a02 100644 --- a/example/diameter/launcher/main.cpp +++ b/example/diameter/launcher/main.cpp @@ -1071,7 +1071,7 @@ int main(int argc, const char** argv) { commandLine.add("log", anna::CommandLine::Argument::Optional, "Process log file (operations result, traffic log, etc.). By default 'launcher.log'. Empty string or \"null\" name, to disable. Warning: there is no rotation for log files (use logrotate or whatever)"); commandLine.add("splitLog", anna::CommandLine::Argument::Optional, "Splits log file (appends to log filename, extensions with the type of event: see help on startup information-level traces). No log files for code/decode and load operations are created", false); commandLine.add("detailedLog", anna::CommandLine::Argument::Optional, "Insert detailed information at log files. Should be disabled on automatic tests. Useful on '-balance' mode to know messages flow along the sockets", false); - commandLine.add("dumpLog", anna::CommandLine::Argument::Optional, "Write to disk every incoming/outcoming message named as '....xml'", false); + commandLine.add("dumpLog", anna::CommandLine::Argument::Optional, "Write to disk every incoming/outcoming message named as '.....xml'", false); 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("burstLog", anna::CommandLine::Argument::Optional, "Burst operations log file. By default 'launcher.burst'. Empty string or \"null\" name, to disable. Warning: there is no rotation for log files (use logrotate or whatever). Output: dot (.) for each burst message sent/pushed, cross (x) for popped ones, and order number when multiple of 1% of burst list size, plus OTA requests when changed."); commandLine.add("cntDir", anna::CommandLine::Argument::Optional, "Counters directory. By default is the current execution directory. Warning: a counter file will be dump per record period; take care about the possible accumulation of files"); @@ -1325,7 +1325,9 @@ void Launcher::writeLogFile(const anna::diameter::codec::Message & decodedMessag name += "."; name += anna::functions::asString(decodedMessage.getId().first); name += "."; - name += ((decodedMessage.getId().second) ? "request.xml":"answer.xml"); + name += ((decodedMessage.getId().second) ? "request.":"answer."); + name += logExtension; + name += ".xml"; ofstream outMsg(name.c_str(), ifstream::out | ifstream::app); outMsg.write(xml.c_str(), xml.size()); outMsg.close();