RSC  0.16.0
Logger.h File Reference
#include <string>
#include <ostream>
#include <sstream>
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include "rsc/rscexports.h"
Include dependency graph for Logger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  rsc::logging::Logger
 Interface for logging adapters that can be used with RSC. More...
 

Namespaces

 rsc
 
 rsc::logging
 Provides a hierarchical logging system with the possibility to install different backends, which are instances of LoggingSystem.
 

Macros

logging utility macros with stream semantics
#define RSCTRACE(logger, msg)
 
#define RSCDEBUG(logger, msg)
 
#define RSCINFO(logger, msg)
 
#define RSCWARN(logger, msg)
 
#define RSCERROR(logger, msg)
 
#define RSCFATAL(logger, msg)
 
expectation logging utility macros with stream semantics

The macros only log if the condition fails.

However they do not let a program terminate and if the logger is not active, nothing will happen.

#define RSCTRACE_EXPECT(condition, logger, msg)
 
#define RSCDEBUG_EXPECT(condition, logger, msg)
 
#define RSCINFO_EXPECT(condition, logger, msg)
 
#define RSCWARN_EXPECT(condition, logger, msg)
 
#define RSCERROR_EXPECT(condition, logger, msg)
 
#define RSCFATAL_EXPECT(condition, logger, msg)
 

Typedefs

typedef boost::shared_ptr< Logger > rsc::logging::LoggerPtr
 

Functions

ostream & rsc::logging::operator<< (ostream &stream, const Logger::Level &level)
 

Macro Definition Documentation

#define RSCDEBUG (   logger,
  msg 
)
Value:
if (logger->isDebugEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg; \
logger->debug(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 217 of file Logger.h.

Referenced by rsc::plugins::Configurator::handleOption(), rsc::plugins::Configurator::loadPlugins(), rsc::threading::RepetitiveTask::run(), rsc::subprocess::UnixSubprocess::UnixSubprocess(), rsc::threading::RepetitiveTask::waitDone(), and rsc::subprocess::UnixSubprocess::~UnixSubprocess().

#define RSCDEBUG_EXPECT (   condition,
  logger,
  msg 
)
Value:
if (!(condition) && logger->isDebugEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg << "\nfailed condition: " << #condition; \
logger->debug(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 269 of file Logger.h.

#define RSCERROR (   logger,
  msg 
)
Value:
if (logger->isErrorEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg; \
logger->error(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 238 of file Logger.h.

Referenced by rsc::subprocess::UnixSubprocess::UnixSubprocess(), and rsc::subprocess::UnixSubprocess::~UnixSubprocess().

#define RSCERROR_EXPECT (   condition,
  logger,
  msg 
)
Value:
if (!(condition) && logger->isErrorEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg << "\nfailed condition: " << #condition; \
logger->error(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 290 of file Logger.h.

#define RSCFATAL (   logger,
  msg 
)
Value:
if (logger->isFatalEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg; \
logger->fatal(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 245 of file Logger.h.

#define RSCFATAL_EXPECT (   condition,
  logger,
  msg 
)
Value:
if (!(condition) && logger->isFatalEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg << "\nfailed condition: " << #condition; \
logger->fatal(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 297 of file Logger.h.

#define RSCINFO (   logger,
  msg 
)
Value:
if (logger->isInfoEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg; \
logger->info(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 224 of file Logger.h.

Referenced by rsc::plugins::Manager::addPath(), rsc::plugins::Configurator::addPathEntries(), rsc::plugins::Impl::load(), rsc::plugins::Impl::resolveSymbol(), and rsc::plugins::Impl::unload().

#define RSCINFO_EXPECT (   condition,
  logger,
  msg 
)
Value:
if (!(condition) && logger->isInfoEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg << "\nfailed condition: " << #condition; \
logger->info(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 276 of file Logger.h.

#define RSCTRACE (   logger,
  msg 
)
Value:
if (logger->isTraceEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg; \
logger->trace(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 210 of file Logger.h.

Referenced by rsc::plugins::Manager::addPath(), rsc::config::ConfigFileSource::ConfigFileSource(), rsc::threading::PeriodicTask::continueExec(), rsc::config::CommandLinePropertySource::provideOptions(), rsc::config::EnvironmentVariableSource::provideOptions(), rsc::threading::RepetitiveTask::run(), rsc::threading::RepetitiveTask::timerAfterCycle(), and rsc::threading::PeriodicTask::~PeriodicTask().

#define RSCTRACE_EXPECT (   condition,
  logger,
  msg 
)
Value:
if (!(condition) && logger->isTraceEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg << "\nfailed condition: " << #condition; \
logger->trace(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 262 of file Logger.h.

#define RSCWARN (   logger,
  msg 
)
Value:
if (logger->isWarnEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg; \
logger->warn(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 231 of file Logger.h.

Referenced by rsc::threading::PeriodicTask::continueExec(), rsc::config::processConfigFile(), and rsc::config::CommandLinePropertySource::provideOptions().

#define RSCWARN_EXPECT (   condition,
  logger,
  msg 
)
Value:
if (!(condition) && logger->isWarnEnabled()) { \
std::stringstream iShouldNeverBeMatchedByClientCode; \
iShouldNeverBeMatchedByClientCode << msg << "\nfailed condition: " << #condition; \
logger->warn(iShouldNeverBeMatchedByClientCode.str()); \
}

Definition at line 283 of file Logger.h.