X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2FpcapDecoder%2Fmain.cpp;h=8029b51ab1a5db2489f8bcf03704c7512fc9e6a5;hb=3190f5702ccfcd2c42c51f4aa3217b249fead77f;hp=6214825cc3f8f5b59632d9235b60eb12d2567518;hpb=4456556fc4cd3d24eab8d555acceae339d476c5b;p=anna.git diff --git a/example/diameter/pcapDecoder/main.cpp b/example/diameter/pcapDecoder/main.cpp index 6214825..8029b51 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 = @@ -416,7 +417,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); } @@ -481,7 +482,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); }