X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fmain.cpp;h=ca439a672e537c80c4e4dc325774f3da41ab2464;hb=0e992a5c0f14d91268d00304d90c7073499ff54e;hp=7b13e12b3980549bca69a614d68ebf32aa18b25e;hpb=61c8b6e85a24b5b6b9e9bc40dbeda77726e57283;p=anna.git diff --git a/example/diameter/launcher/main.cpp b/example/diameter/launcher/main.cpp index 7b13e12..ca439a6 100644 --- a/example/diameter/launcher/main.cpp +++ b/example/diameter/launcher/main.cpp @@ -17,17 +17,31 @@ // 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; anna::http::functions::initialize(); - std::cout << "XXXXXXXXXXXXXXXXXXXXXXX " << anna::functions::hash("hola que tal") << std::endl; - try { anna::CommandLine& commandLine(anna::CommandLine::instantiate()); // General