Changes between Version 1 and Version 2 of Documentation/Logging


Ignore:
Timestamp:
Apr 7, 2011, 4:34:31 PM (14 years ago)
Author:
Christoph Mayer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/Logging

    v1 v2  
    55All important definitions can be found in "ariba/utility/logging/Logging.h" To use logging in your application on a per-class basis, perform the following steps:
    66
    7  * Include the logging header {{{#include "ariba/utility/logging/Logging.h}}} in the header of your class where you want to use logging.
     7 * If you want to use colors for the different logging-levels you can use the option {{{--enable-logcolors=yes}}}
    88
    9  *  Right inside the class definition to the following:
     9 * Include the logging header {{{#include "ariba/utility/logging/Logging.h"}}} in the header of your class where you want to use logging.
    1010
    11 {{{}}}
     11 *  Right inside the class definition of your {{{.h}}} class {{{TestClass}}} to use the following: {{{use_logging_h(TestClass)}}}. In the {{{.cpp}}} source file use {{{use_logging_cpp(TestClass)}}}.
     12
     13 * The order of log-level is "debug", "info", "warning", "error". The default log-level is "info".
     14
     15 * To change the default log-level you can use the functions
     16  * {{{logging_rootlevel_debug();}}}
     17  * {{{logging_rootlevel_info();}}}
     18  * {{{logging_rootlevel_warn();}}}
     19  * {{{logging_rootlevel_error();}}}
     20
     21 * To change the individual log-level of a class you can e.g. first set the global level to "warn" and then for your test-class to "debug". This feature is only available when you have log4cxx installed
     22{{{
     23     logging_rootlevel_warn();
     24     logging_classlevel_debug("TestClass");
     25}}}
     26
     27 * The log-level functions for individual classes are
     28  * {{{logging_classlevel_debug("TestClass")}}}
     29  * {{{logging_classlevel_info("TestClass")}}}
     30  * {{{logging_classlevel_warn("TestClass")}}}
     31  * {{{logging_classlevel_error("TestClass")}}}
     32
     33 * Finally, the functions to actually perform logging at the different levels are ("fatal" will kill the program)
     34  * {{{logging_debug("this is a log message")}}}
     35  * {{{logging_info("this is a log message")}}}
     36  * {{{logging_warn("this is a log message")}}}
     37  * {{{logging_error("this is a log message")}}}
     38  * {{{logging_fatal("this is a log message")}}}