Medical Imaging Interaction Toolkit
2023.04.00
Medical Imaging Interaction Toolkit
|
Go to the documentation of this file.
68 inline PseudoStream(
int level,
const char *filePath,
int lineNumber,
const char *functionName)
69 : disabled(false), msg(
LogMessage(level, filePath, lineNumber, functionName)), ss(std::stringstream::out)
91 std::locale originalLocale = ss.getloc();
96 ss.imbue(originalLocale);
108 std::locale originalLocale = ss.getloc();
113 ss.imbue(originalLocale);
124 std::locale originalLocale = ss.getloc();
129 ss.imbue(originalLocale);
150 disabled |= !enabled;
208 #define MBI_INFO mbilog::PseudoStream(mbilog::Info, __FILE__, __LINE__, __FUNCTION__)
209 #define MBI_WARN mbilog::PseudoStream(mbilog::Warn, __FILE__, __LINE__, __FUNCTION__)
210 #define MBI_ERROR mbilog::PseudoStream(mbilog::Error, __FILE__, __LINE__, __FUNCTION__)
211 #define MBI_FATAL mbilog::PseudoStream(mbilog::Fatal, __FILE__, __LINE__, __FUNCTION__)
215 #ifdef MBILOG_ENABLE_DEBUG
216 #define MBI_DEBUG mbilog::PseudoStream(mbilog::Debug, __FILE__, __LINE__, __FUNCTION__)
218 #define MBI_DEBUG true ? mbilog::NullStream() : mbilog::NullStream() // this is magic by markus
NullStream & operator()(const char *)
An object of this class represents a single logging message (logging event) of the mbi logging mechan...
void MBILOG_EXPORT DisableBackends(OutputType type)
PseudoStream & operator<<(std::ostream &(*func)(std::ostream &))
Definition of the bit shift operator for this class (for functions).
#define MBILOG_MODULENAME
void MBILOG_EXPORT DistributeToBackends(LogMessage &l)
Distributes the given message to all registered backends. Should only be called by objects of the cla...
NullStream & operator()(bool)
~PseudoStream()
The message which is stored in the member ss is written to the backend.
This class is an interface for logging backends that can be registered in the mbi logging mechanism.
const char * moduleName
Name of the module where the logging message was emitted which is generated by the macros in file mbi...
void MBILOG_EXPORT UnregisterBackend(BackendBase *backend)
Unregisters a backend.
An object of this class simulates a std::cout stream. This means messages can be added by using the b...
void MBILOG_EXPORT RegisterBackend(BackendBase *backend)
Registeres a backend to the mbi logging mechanism. If a backend is registered here,...
An object of this class simulates a std::cout stream but does nothing. This class is for dummy object...
PseudoStream & operator()(bool enabled)
Enables/disables the PseudoStream. If set to false parsing and output is suppressed.
std::string category
Category of the logging event, which was defined by the user.
PseudoStream & operator<<(const T &data)
Definition of the bit shift operator for this class.
NullStream & operator<<(T &)
NullStream & operator<<(const T &)
PseudoStream & operator()(const char *category)
Sets the category of this PseudoStream object. If there already is a category it is appended,...
void MBILOG_EXPORT EnableBackends(OutputType type)
std::string message
The actual logging message.
NullStream & operator<<(std::ostream &(*)(std::ostream &))
PseudoStream & operator<<(T &data)
Definition of the bit shift operator for this class (for non const data).
PseudoStream(int level, const char *filePath, int lineNumber, const char *functionName)
bool MBILOG_EXPORT IsBackendEnabled(OutputType type)