X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FMainpage.dox;h=7a5509d6599d071c910cbc40c474ce24888f1269;hb=412024ed31a4ab4eaea7a4165a434f8efebee325;hp=d7a7e898ac224a105028a3fef95b6929342457ed;hpb=012a592d56be453719b7fbba492b56ae804c048f;p=senf.git diff --git a/Utils/Logger/Mainpage.dox b/Utils/Logger/Mainpage.dox index d7a7e89..7a5509d 100644 --- a/Utils/Logger/Mainpage.dox +++ b/Utils/Logger/Mainpage.dox @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -44,13 +44,13 @@ A \e stream combines log messages with a single purpose: Debug messages, access logging and so on. Any number of streams may be defined. There is one predefined default stream called \c - senf::log::Debug. (see: \ref SENF_LOG_DEF_STREAM) + senf::log::Debug. (see: \ref SENF_LOG_DEFINE_STREAM) The \e area gives information about the source location of the message. Areas may be defined and assigned arbitrarily but should be used to label messages from a single class or subsystem. It is possible to reuse a class as it's own area tag, which is often desireable. There is a default area \c senf::log::DefaultArea which is used, when no other area is assigned. (see: \ref - SENF_LOG_DEF_AREA, \ref SENF_LOG_CLASS_AREA) + SENF_LOG_DEFINE_AREA, \ref SENF_LOG_CLASS_AREA) The log \e level gives information on the importance of the message. The list of log-levels is fixed. (see: \ref loglevels) @@ -59,6 +59,15 @@ or disabled at \e compile time. Messages disabled at compile time should not generate any code. (see: \ref SENF_LOG_CONF) + \attention The default log stream senf::log::Debug has senf::log::VERBOSE messages + disabled at compile time. senf::log::VERBOSE message will therefore only appear, + if you explictly enable the messages for the area in question using (here for the area + some::Area) +
 
+        g++ ... -DSENF_LOG_CONF="(( (senf)(log)(Debug), (some)(Area), VERBOSE ))" 
+        
+ in addition to routing the messages at runtime. For more, see \ref config. + To be of any use, the log messages have to be written somewhere. This is the responsibility of any number of \e targets. A \e target receives messages and using it's routing information decides, wether the message is output or not. A message may be routed to multiple targets @@ -74,12 +83,12 @@ // Define a new log stream with default level, runtime limit and compile time limit // set to senf::log::MESSAGE - SENF_LOG_DEF_STREAM( UserLog, senf::log::MESSAGE, senf::log::MESSAGE, senf::log::MESSAGE ); + SENF_LOG_DEFINE_STREAM( UserLog, senf::log::MESSAGE, senf::log::MESSAGE, senf::log::MESSAGE ); class Froblizer { // Define a log area which will automatically be used by all members of this class. - // This is a combination of SENF_LOG_DEF_AREA and SENF_LOG_DEFAULT_AREA. + // This is a combination of SENF_LOG_DEFINE_AREA and SENF_LOG_DEFAULT_AREA. SENF_LOG_CLASS_AREA(); // Set default log parameters for this scope. @@ -89,7 +98,7 @@ // Define an alias for emergency debug messages // The log area is inherited from the default at the place, where this // alias is used *not* where it is defined - SENF_LOG_DEF_ALIAS(LogEmerg, (senf::log::Debug)(senf::log::CRITICAL)); + SENF_LOG_DEFINE_ALIAS(LogEmerg, (senf::log::Debug)(senf::log::CRITICAL)); void test(); @@ -101,7 +110,7 @@ void foo::Froblizer::froblize() { SENF_LOG(("This is the UserLog at level NOTICE in the FroblizeArea")); - SENF_LOG((senf::log::WARNING) ("Same stream and area but at warning level")); + SENF_LOG((senf::log::IMPORTANT) ("Same stream and area but at important level")); SENF_LOG((LogEmerg) ("This goes to the DebugLog at level CRITICAL in the FroblizerArea")); } @@ -117,7 +126,7 @@ int main(int, char **) { // Set up the routing targets - senf::log::ConsoleTarget console; + senf::log::ConsoleTarget & console (senf::log::ConsoleTarget::instance()); senf::log::FileTarget logfile ("my.log"); // Debug messages go to the console