X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2FpcapDecoder%2Fmain.cpp;h=30d9cbae62716f03f955f2c88ee9ac9a51ab2fbb;hb=55894c46ed34bb4a8f06fecbaaa8f8bcb48c8784;hp=0f5fde6c549b83d364332b8589f10a87ae8e2c12;hpb=8ae9ca58ae814320a13b9a665fafc4b498ecdba3;p=anna.git diff --git a/example/diameter/pcapDecoder/main.cpp b/example/diameter/pcapDecoder/main.cpp index 0f5fde6..30d9cba 100644 --- a/example/diameter/pcapDecoder/main.cpp +++ b/example/diameter/pcapDecoder/main.cpp @@ -327,7 +327,8 @@ 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::string execBN = exec.substr(exec.find_last_of("/") + 1); + std::string filetrace = execBN + ".trace"; std::cout << std::endl; //check command line arguments @@ -352,7 +353,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(filetrace.c_str(), 2048000)); + Logger::initialize(execBN.c_str(), new TraceWriter(filetrace.c_str(), 2048000)); anna::diameter::codec::Engine *codecEngine = new anna::diameter::codec::Engine(); anna::diameter::stack::Engine &stackEngine = @@ -417,7 +418,7 @@ int main(int argc, char **argv) { out << G_codecMsg.asXMLString(); // Close output file: out.close(); - std::string msg = "Open 'file.trace' in order to see process traces.\n"; + std::string msg = "Open '"; msg += filetrace; msg += "' in order to see process traces.\n"; msg += "Open '"; msg += outputFile; msg += "' to see decoding results."; _exit(msg, 0); } @@ -482,7 +483,7 @@ int main(int argc, char **argv) { // Close output file: out.close(); - std::string msg = "Open 'file.trace' in order to see process traces.\n"; + std::string msg = "Open '"; msg += filetrace; msg += "' in order to see process traces.\n"; msg += "Open '"; msg += outputFile; msg += "' to see decoding results."; _exit(msg, 0); }