Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mbilog Namespace Reference

Classes

class  BackendBase
 This class is an interface for logging backends that can be registered in the mbi logging mechanism. More...
 
class  BackendCout
 Default backend of the mbi logging mechanism. This backend is used if no other backend is registered. The backend formats the logging messages to a normal string and writes them to std::cout. More...
 
class  LogMessage
 An object of this class represents a single logging message (logging event) of the mbi logging mechanism. Logging message should only be generated by the macros in the class mbilog.h. More...
 
class  NullStream
 An object of this class simulates a std::cout stream but does nothing. This class is for dummy objects, bit shift operators are availiable but doing nothing. Should only be used by the macros defined in the file mbilog.h. More...
 
class  PseudoStream
 An object of this class simulates a std::cout stream. This means messages can be added by using the bit shift operator (<<). Should only be used by the macros defined in the file mbilog.h. More...
 
class  TextBackendBase
 This class is an abstract superclass for logging text backends. It adds string formatting methods to the backend interface BackendBase. Accordingly backends that inherit from this class can be registered in the mbi logging mechanism. More...
 

Enumerations

enum  {
  Info, Warn, Error, Fatal,
  Debug
}
 This enum defines the message/event levels of the mbi logging mechanism. Info: TODO Warn: TODO Error: TODO Fatal: TODO Debug: TODO. More...
 

Functions

void MBILOG_EXPORT RegisterBackend (BackendBase *backend)
 Registeres a backend to the mbi logging mechanism. If a backend is registered here, all mbilog messages are relayed to this backend through the method ProcessMessage. If no backend is registered the default backend is used. More...
 
void MBILOG_EXPORT UnregisterBackend (BackendBase *backend)
 Unregisters a backend. More...
 
void MBILOG_EXPORT DistributeToBackends (LogMessage &l)
 Distributes the given message to all registered backends. Should only be called by objects of the class pseudo stream. More...
 
void MBILOG_EXPORT EnableBackends (OutputType type)
 
void MBILOG_EXPORT DisableBackends (OutputType type)
 
bool MBILOG_EXPORT IsBackendEnabled (OutputType type)
 

Variables

static const std::string NA_STRING
 
static const char * replace []
 This is a dictionary to replace long names of classes, modules, etc. to shorter versions in the console output. More...
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

This enum defines the message/event levels of the mbi logging mechanism. Info: TODO Warn: TODO Error: TODO Fatal: TODO Debug: TODO.

Enumerator
Info 
Warn 
Error 
Fatal 
Debug 

Definition at line 25 of file mbilogLoggingTypes.h.

Function Documentation

◆ DisableBackends()

void mbilog::DisableBackends ( OutputType  type)

Disable the output of a backend.

Definition at line 75 of file mbilog.cpp.

◆ DistributeToBackends()

void mbilog::DistributeToBackends ( mbilog::LogMessage l)

Distributes the given message to all registered backends. Should only be called by objects of the class pseudo stream.

Definition at line 36 of file mbilog.cpp.

References IsBackendEnabled(), mbilog::LogMessage::message, mbilog::BackendCout::ProcessMessage(), RegisterBackend(), mbilog::BackendCout::SetFull(), and UnregisterBackend().

Referenced by mbilog::PseudoStream::~PseudoStream().

◆ EnableBackends()

void mbilog::EnableBackends ( OutputType  type)

Enable the output of a backend.

Definition at line 70 of file mbilog.cpp.

◆ IsBackendEnabled()

bool mbilog::IsBackendEnabled ( OutputType  type)

Checks wether the output of this backend is enabled.

Definition at line 80 of file mbilog.cpp.

Referenced by DistributeToBackends().

◆ RegisterBackend()

void mbilog::RegisterBackend ( mbilog::BackendBase backend)

Registeres a backend to the mbi logging mechanism. If a backend is registered here, all mbilog messages are relayed to this backend through the method ProcessMessage. If no backend is registered the default backend is used.

Definition at line 26 of file mbilog.cpp.

Referenced by DistributeToBackends(), and mitk::LoggingBackend::Register().

◆ UnregisterBackend()

void mbilog::UnregisterBackend ( mbilog::BackendBase backend)

Unregisters a backend.

Definition at line 31 of file mbilog.cpp.

Referenced by DistributeToBackends(), and mitk::LoggingBackend::Unregister().

Variable Documentation

◆ NA_STRING

const std::string mbilog::NA_STRING
static

Definition at line 23 of file mbilog.cpp.

◆ replace