X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fmain.cpp;h=ca439a672e537c80c4e4dc325774f3da41ab2464;hb=cc05f3d8a5100af6415f9520813e3326f7ffd69f;hp=6f2a6533851bde43ef661fca1bde878f957987b2;hpb=0c533bf948a63d134c8001e16b15194b197cb99a;p=anna.git diff --git a/example/diameter/launcher/main.cpp b/example/diameter/launcher/main.cpp index 6f2a653..ca439a6 100644 --- a/example/diameter/launcher/main.cpp +++ b/example/diameter/launcher/main.cpp @@ -17,10 +17,26 @@ // 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_cwd[ PATH_MAX ]; + std::string trace_file; + if (getcwd(c_cwd, sizeof(c_cwd)) != NULL) { + trace_file = c_cwd; + trace_file += "/launcher.trace"; + } else { + perror("getcwd() error"); + return 1; + } + + anna::Logger::initialize("launcher", new TraceWriter(trace_file.c_str(), 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;