From: Eduardo Ramos Testillano Date: Sat, 4 Apr 2015 12:07:47 +0000 (+0200) Subject: Use exec basename as file name for traces X-Git-Tag: REFACTORING_TESTING_LIBRARY~193 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=8ae9ca58ae814320a13b9a665fafc4b498ecdba3;p=anna.git Use exec basename as file name for traces --- diff --git a/example/diameter/pcapDecoder/main.cpp b/example/diameter/pcapDecoder/main.cpp index 6214825..0f5fde6 100644 --- a/example/diameter/pcapDecoder/main.cpp +++ b/example/diameter/pcapDecoder/main.cpp @@ -327,6 +327,7 @@ void _exit(const std::string &message, int resultCode = 1) { //------------------------------------------------------------------- int main(int argc, char **argv) { std::string exec = argv[0]; + std::string filetrace = exec.substr(exec.find_last_of("/") + 1) + ".trace"; std::cout << std::endl; //check command line arguments @@ -351,7 +352,7 @@ int main(int argc, char **argv) { << (ignoreFlags ? "non strict" : "strict") << std::endl; // Logger and engines: Logger::setLevel(Logger::Debug); - Logger::initialize("pcapDecoder", new TraceWriter("file.trace", 2048000)); + Logger::initialize("pcapDecoder", new TraceWriter(filetrace.c_str(), 2048000)); anna::diameter::codec::Engine *codecEngine = new anna::diameter::codec::Engine(); anna::diameter::stack::Engine &stackEngine =