OBTTrace.h File Reference

#include <set>
#include <map>
#include <string>
#include <sstream>
#include <fstream>
#include "OBT.h"
#include "OBTSingleton.h"
#include "OBT_Exception.h"
Include dependency graph for OBTTrace.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OBT::TracerOutput
 Interface to output messages in a console. More...
class  OBT::Tracer
 Tracer used to output messages. More...

Namespaces

namespace  OBT

Defines

#define TRACE(ID, MSG)
 Send a ID message to the log.
#define TRACE_CRITICAL(MSG)   TRACE( OBT_TRACE_CRITICAL, MSG )
 Send a critical message to the log.
#define TRACE_ERROR(MSG)   TRACE( OBT_TRACE_ERROR, MSG )
 Send an error message to the log.
#define TRACE_WARNING(MSG)   TRACE( OBT_TRACE_WARNING, MSG )
 Send a warning message to the log.
#define TRACE_NOTICE(MSG)   TRACE( OBT_TRACE_NOTICE, MSG )
 Send a notice message to the log.
#define TRACE_INFO(MSG)   TRACE( OBT_TRACE_INFO, MSG )
 Send an info message to the log.
#define TRACE_DEBUG(MSG)   TRACE( OBT_TRACE_DEBUG, MSG )
 Send a debug message to the log.

Variables

template class OBT_API OBT::Singleton< Tracer >
 The Tracer singleton.
OBT_API const unsigned int OBT_TRACE_CRITICAL
 Id for TRACE_CRITICAL message.
OBT_API const unsigned int OBT_TRACE_ERROR
 Id for TRACE_ERROR message.
OBT_API const unsigned int OBT_TRACE_WARNING
 Id for TRACE_WARNING message.
OBT_API const unsigned int OBT_TRACE_NOTICE
 Id for TRACE_NOTICE message.
OBT_API const unsigned int OBT_TRACE_INFO
 Id for TRACE_INFO message.
OBT_API const unsigned int OBT_TRACE_DEBUG
 Id for TRACE_DEBUG message.

Define Documentation

#define TRACE ( ID,
MSG   ) 
Value:
{ \
  OBT::Tracer& tracer = OBT::Singleton< OBT::Tracer >::getInstance() ; \
  try \
  { \
    if( tracer.test( ID ) ) \
    { \
      std::ostringstream msgForDebugTRACE ; \
      msgForDebugTRACE << MSG ; \
      tracer.trace( ID, __FUNCTION__, __FILE__, __LINE__, msgForDebugTRACE.str().c_str() ); \
    } \
  } \
  catch ( OBT::OBT_Exception& exception ) \
  { \
    tracer.trace( ID, __FUNCTION__, __FILE__, __LINE__, exception.what() ); \
  } \
}

Send a ID message to the log.

The message is logged only if the ID is previously registered.

Definition at line 292 of file OBTTrace.h.

#define TRACE_CRITICAL ( MSG   )     TRACE( OBT_TRACE_CRITICAL, MSG )

Send a critical message to the log.

Definition at line 312 of file OBTTrace.h.

#define TRACE_DEBUG ( MSG   )     TRACE( OBT_TRACE_DEBUG, MSG )

Send a debug message to the log.

Definition at line 331 of file OBTTrace.h.

#define TRACE_ERROR ( MSG   )     TRACE( OBT_TRACE_ERROR, MSG )
#define TRACE_INFO ( MSG   )     TRACE( OBT_TRACE_INFO, MSG )

Send an info message to the log.

Definition at line 327 of file OBTTrace.h.

Referenced by OBT::PluginLoaderImpl::load().

#define TRACE_NOTICE ( MSG   )     TRACE( OBT_TRACE_NOTICE, MSG )

Send a notice message to the log.

Definition at line 323 of file OBTTrace.h.

#define TRACE_WARNING ( MSG   )     TRACE( OBT_TRACE_WARNING, MSG )

Send a warning message to the log.

Definition at line 319 of file OBTTrace.h.

Referenced by OBT::getService(), and OBT::getServices().


Variable Documentation

OBT_API const unsigned int OBT_TRACE_CRITICAL

Id for TRACE_CRITICAL message.

Definition at line 10 of file OBTTrace.cpp.

OBT_API const unsigned int OBT_TRACE_DEBUG

Id for TRACE_DEBUG message.

Definition at line 20 of file OBTTrace.cpp.

OBT_API const unsigned int OBT_TRACE_ERROR

Id for TRACE_ERROR message.

Definition at line 12 of file OBTTrace.cpp.

OBT_API const unsigned int OBT_TRACE_INFO

Id for TRACE_INFO message.

Definition at line 18 of file OBTTrace.cpp.

OBT_API const unsigned int OBT_TRACE_NOTICE

Id for TRACE_NOTICE message.

Definition at line 16 of file OBTTrace.cpp.

OBT_API const unsigned int OBT_TRACE_WARNING

Id for TRACE_WARNING message.

Definition at line 14 of file OBTTrace.cpp.


Generated on 1 Jan 2010 for OBT by  doxygen 1.6.1