ibrcommon/ibrcommon/Logger.h File Reference

#include <iostream>
#include <sstream>
#include <list>

Go to the source code of this file.

Classes

class  ibrcommon::Logger
class  ibrcommon::Logger::endl_flag
class  ibrcommon::Logger::LoggerOutput

Namespaces

namespace  ibrcommon

Defines

#define IBRCOMMON_LOGGER(level)   { ibrcommon::Logger log = ibrcommon::Logger::level(); log
#define IBRCOMMON_LOGGER_DEBUG(verbosity)   { ibrcommon::Logger log = ibrcommon::Logger::debug(verbosity); log
#define IBRCOMMON_LOGGER_ENDL   std::flush; log << ibrcommon::Logger::endl; }
#define IBRCOMMON_LOGGER_LEVEL   ibrcommon::Logger::getVerbosity()

Detailed Description

This file provides common logging facilities. For easy usage it provides some defines and is usable like a standard output stream. It is fully configurable, can log to all standard output streams and to the system syslog.

Provided tags: emergency, alert, critical, error, warning, notice, info

Example log message with info tag:

 IBRCOMMON_LOGGER(info) << "Some output..." << IBRCOMMON_ENDL;

Example debug with verbose level 42:

 IBRCOMMON_LOGGER_DEBUG(42) << "some debugging output" << IBRCOMMON_ENDL;

To check the current verbose level in the code use the IBRCOMMON_LOGGER_LEVEL define like this:

 if (IBRCOMMON_LOGGER_LEVEL > 42)
 {
                do something...
 }

Definition in file Logger.h.


Define Documentation

#define IBRCOMMON_LOGGER ( level   )     { ibrcommon::Logger log = ibrcommon::Logger::level(); log
#define IBRCOMMON_LOGGER_DEBUG ( verbosity   )     { ibrcommon::Logger log = ibrcommon::Logger::debug(verbosity); log
#define IBRCOMMON_LOGGER_ENDL   std::flush; log << ibrcommon::Logger::endl; }
#define IBRCOMMON_LOGGER_LEVEL   ibrcommon::Logger::getVerbosity()

Definition at line 48 of file Logger.h.

Referenced by dtn::net::ConnectionManager::queue().

Generated on Mon Aug 23 08:12:57 2010 for IBR-DTNSuite by  doxygen 1.6.3