cxxtools.h File Reference
#include <string>
#include <iostream>

Go to the source code of this file.

Classes

class  cxxtools::Logger
class  cxxtools::LoggerManagerConfiguration
class  cxxtools::LoggerManager
class  cxxtools::LogMessage
class  cxxtools::LogTracer

Namespaces

namespace  cxxtools

Macros

#define _cxxtools_log_enabled(level)   (getLogger() != 0 && getLogger()->isEnabled(::cxxtools::Logger::LOG_LEVEL_ ## level))
#define _cxxtools_log(level, expr)
#define _cxxtools_log_if(level, cond, expr)
#define log_fatal_enabled()   _cxxtools_log_enabled(FATAL)
#define log_error_enabled()   _cxxtools_log_enabled(ERROR)
#define log_warn_enabled()   _cxxtools_log_enabled(WARN)
#define log_info_enabled()   _cxxtools_log_enabled(INFO)
#define log_debug_enabled()   _cxxtools_log_enabled(DEBUG)
#define log_trace_enabled()   _cxxtools_log_enabled(TRACE)
#define log_fatal(expr)   _cxxtools_log(FATAL, expr)
#define log_error(expr)   _cxxtools_log(ERROR, expr)
#define log_warn(expr)   _cxxtools_log(WARN, expr)
#define log_info(expr)   _cxxtools_log(INFO, expr)
#define log_debug(expr)   _cxxtools_log(DEBUG, expr)
#define log_fatal_if(cond, expr)   _cxxtools_log_if(FATAL, cond, expr)
#define log_error_if(cond, expr)   _cxxtools_log_if(ERROR, cond, expr)
#define log_warn_if(cond, expr)   _cxxtools_log_if(WARN, cond, expr)
#define log_info_if(cond, expr)   _cxxtools_log_if(INFO, cond, expr)
#define log_debug_if(cond, expr)   _cxxtools_log_if(DEBUG, cond, expr)
#define log_trace(expr)
#define log_define(category)
#define log_init_cxxtools   ::cxxtools::LoggerManager::logInit
#define log_init   log_init_cxxtools

Functions

void cxxtools::operator>>= (const SerializationInfo &si, LoggerManagerConfiguration &loggerManagerConfiguration)

Macro Definition Documentation

#define _cxxtools_log (   level,
  expr 
)
Value:
do { \
::cxxtools::Logger* _cxxtools_logger = getLogger(); \
if (_cxxtools_logger != 0 && _cxxtools_logger->isEnabled(::cxxtools::Logger::LOG_LEVEL_ ## level)) \
{ \
::cxxtools::LogMessage _cxxtools_logMessage(_cxxtools_logger, #level); \
_cxxtools_logMessage.out() << expr; \
_cxxtools_logMessage.finish(); \
} \
} while (false)
#define _cxxtools_log_enabled (   level)    (getLogger() != 0 && getLogger()->isEnabled(::cxxtools::Logger::LOG_LEVEL_ ## level))
#define _cxxtools_log_if (   level,
  cond,
  expr 
)
Value:
do { \
::cxxtools::Logger* _cxxtools_logger = getLogger(); \
if (_cxxtools_logger != 0 && _cxxtools_logger->isEnabled(::cxxtools::Logger::LOG_LEVEL_ ## level) && (cond)) \
{ \
::cxxtools::LogMessage _cxxtools_logMessage(_cxxtools_logger, #level); \
_cxxtools_logMessage.out() << expr; \
_cxxtools_logMessage.finish(); \
} \
} while (false)
#define log_debug (   expr)    _cxxtools_log(DEBUG, expr)
#define log_debug_enabled ( )    _cxxtools_log_enabled(DEBUG)
#define log_debug_if (   cond,
  expr 
)    _cxxtools_log_if(DEBUG, cond, expr)
#define log_define (   category)
Value:
static ::cxxtools::Logger* getLogger() \
{ \
static cxxtools::Logger* logger = 0; \
return 0; \
if (logger == 0) \
return logger; \
}
#define log_error (   expr)    _cxxtools_log(ERROR, expr)
#define log_error_enabled ( )    _cxxtools_log_enabled(ERROR)
#define log_error_if (   cond,
  expr 
)    _cxxtools_log_if(ERROR, cond, expr)
#define log_fatal (   expr)    _cxxtools_log(FATAL, expr)
#define log_fatal_enabled ( )    _cxxtools_log_enabled(FATAL)
#define log_fatal_if (   cond,
  expr 
)    _cxxtools_log_if(FATAL, cond, expr)
#define log_info (   expr)    _cxxtools_log(INFO, expr)
#define log_info_enabled ( )    _cxxtools_log_enabled(INFO)
#define log_info_if (   cond,
  expr 
)    _cxxtools_log_if(INFO, cond, expr)
#define log_init   log_init_cxxtools
#define log_init_cxxtools   ::cxxtools::LoggerManager::logInit
#define log_trace (   expr)
Value:
::cxxtools::LogTracer _cxxtools_tracer; \
do { \
::cxxtools::Logger* _cxxtools_logger = getLogger(); \
if (_cxxtools_logger != 0 && _cxxtools_logger->isEnabled(::cxxtools::Logger::LOG_LEVEL_TRACE)) \
{ \
_cxxtools_tracer.setLogger(_cxxtools_logger); \
_cxxtools_tracer.out() << expr; \
_cxxtools_tracer.enter(); \
} \
} while (false)
#define log_trace_enabled ( )    _cxxtools_log_enabled(TRACE)
#define log_warn (   expr)    _cxxtools_log(WARN, expr)
#define log_warn_enabled ( )    _cxxtools_log_enabled(WARN)
#define log_warn_if (   cond,
  expr 
)    _cxxtools_log_if(WARN, cond, expr)