X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fmain.cpp;h=599e4fe7ca9adf6fe6004a39f660f8e1ec36f9bb;hb=4e62c7a87e40daab037ea709989e185efddc18c8;hp=b603dee22c2440ccfbee9eb821ff9c217ca6a5df;hpb=5bf5055ab79aaf464e2491cfbab173ba37ba3419;p=anna.git diff --git a/example/diameter/launcher/main.cpp b/example/diameter/launcher/main.cpp index b603dee..599e4fe 100644 --- a/example/diameter/launcher/main.cpp +++ b/example/diameter/launcher/main.cpp @@ -17,10 +17,22 @@ // Process #include +// To calculate the current working directory and get an absolute path for traces: +#include +#include + int main(int argc, const char** argv) { anna::Logger::setLevel(anna::Logger::Warning); - anna::Logger::initialize("launcher", new TraceWriter("launcher.trace", 2048000)); + + // Current working directory and absolute trace path file: + char c_exe[ PATH_MAX ]; + ssize_t count = readlink( "/proc/self/exe", c_exe, PATH_MAX ); + std::string exe(c_exe, (count > 0) ? count : 0 ); + std::string cwd = exe.substr(0, exe.find_last_of("/")); + std::string trace_file = cwd + "/launcher.trace"; + + anna::Logger::initialize("launcher", new TraceWriter(trace_file, 2048000)); anna::time::functions::initialize(); // before application instantiation (it have a anna::time object) anna::time::functions::setControlPoint(); // start control point (application lifetime) Launcher app; @@ -34,7 +46,7 @@ int main(int argc, const char** argv) { 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"); 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|result'); 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("logStatisticSamples", anna::CommandLine::Argument::Optional, "Log statistics samples for the provided comma-separated concept id list, over './sample..csv' files. For example: \"1,2\" will log concepts 1 and 2. Reserved words \"all\"/\"none\" activates/deactivates 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 node configuration regarding traffic log in order to disable it and ease production or system test startup.", false); // Communications