From: g0dil Date: Wed, 7 Nov 2007 11:59:18 +0000 (+0000) Subject: Utils/Logger; Small documentation fix X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=9060358b468cab462be61aa34e93f7dfd60894f2;p=senf.git Utils/Logger; Small documentation fix Utils: Catch exceptions in senf::Daemin in non-debug build git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@496 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Utils/DaemonTools.cc b/Utils/DaemonTools.cc index c8fe63e..1896a5c 100644 --- a/Utils/DaemonTools.cc +++ b/Utils/DaemonTools.cc @@ -87,12 +87,29 @@ prefix_ int senf::Daemon::start(int argc, char const ** argv) argc_ = argc; argv_ = argv; +# ifdef NDEBUG + try { +# endif + configure(); if (daemonize_) fork(); if (! pidfile_.empty()) pidfileCreate(); main(); + +# ifdef NDEBUG + } + catch (std::exception & e) { + std::cerr << "\n*** Fatal exception: " << e.what() << std::endl; + return 1; + } + catch (...) { + std::cerr << "\n*** Fatal exception: (unknown)" << std::endl; + return 1; + } +# endif + return 0; } @@ -123,6 +140,11 @@ prefix_ void senf::Daemon::init() prefix_ void senf::Daemon::run() {} +prefix_ void senf::Daemon::fork() +{ + +} + prefix_ void senf::Daemon::pidfileCreate() {} diff --git a/Utils/Logger/Config.hh b/Utils/Logger/Config.hh index 4ffb5ac..8e0eda3 100644 --- a/Utils/Logger/Config.hh +++ b/Utils/Logger/Config.hh @@ -71,7 +71,7 @@ The runtime configuration is performed by routing messages to one or more logging targets: \code - senf::log::ConsoleLog consoleLog; + senf::log::ConsoleLog & consoleLog (senf::log::ConsoleLog::instance()); senf::log::FileLog fileLog ("my.log"); consoleLog.route(); @@ -79,10 +79,11 @@ consoleLog.route(); fileLog.route(); - \endcode Here we see an already relatively complex setup: All debug messages (that is, those, - which are not disabled at compile time) are routed to the console. We also route important - transactions to the console \e except transactions from the \c foo::SomeClass area. The \c - fileLog simply receives all transaction log messages. + \endcode + Here we see an already relatively complex setup: All debug messages (that is, those, which are + not disabled at compile time) are routed to the console. We also route important transactions to + the console \e except transactions from the \c foo::SomeClass area. The \c fileLog simply + receives all transaction log messages. The routing statements are processed by the targets in order, the first matching rule will decide a log messages fate for that target.