Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mbilog.h File Reference
#include <sstream>
#include "mbilogBackendBase.h"
#include "mbilogBackendCout.h"
#include "mbilogConfig.h"
#include "mbilogExports.h"
#include "mbilogLogMessage.h"
#include "mbilogLoggingTypes.h"

Go to the source code of this file.

Classes

class  mbilog::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  mbilog::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...
 

Namespaces

 mbilog
 

Macros

#define MBI_INFO
 Macros for different message levels. Creates an instance of class PseudoStream with the corresponding message level. Other parameters are the name of the source file, line of the source code and function name which are generated by the compiler. More...
 
#define MBI_WARN
 
#define MBI_ERROR
 
#define MBI_FATAL
 
#define MBI_DEBUG
 Macro for the debug messages. The messages are disabled if the cmake variable MBILOG_ENABLE_DEBUG is false. More...
 

Functions

void MBILOG_EXPORT mbilog::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 mbilog::UnregisterBackend (BackendBase *backend)
 Unregisters a backend. More...
 
void MBILOG_EXPORT mbilog::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 mbilog::EnableBackends (OutputType type)
 
void MBILOG_EXPORT mbilog::DisableBackends (OutputType type)
 
bool MBILOG_EXPORT mbilog::IsBackendEnabled (OutputType type)
 

Macro Definition Documentation

◆ MBI_DEBUG

#define MBI_DEBUG

Macro for the debug messages. The messages are disabled if the cmake variable MBILOG_ENABLE_DEBUG is false.

Definition at line 218 of file mbilog.h.

◆ MBI_ERROR

#define MBI_ERROR

Definition at line 210 of file mbilog.h.

◆ MBI_FATAL

#define MBI_FATAL

Definition at line 211 of file mbilog.h.

◆ MBI_INFO

#define MBI_INFO

Macros for different message levels. Creates an instance of class PseudoStream with the corresponding message level. Other parameters are the name of the source file, line of the source code and function name which are generated by the compiler.

Definition at line 208 of file mbilog.h.

◆ MBI_WARN

#define MBI_WARN

Definition at line 209 of file mbilog.h.