Medical Imaging Interaction Toolkit
2024.06.99-e4ca64e0
Medical Imaging Interaction Toolkit
|
Go to the documentation of this file.
22 #ifndef MITKLOG_MODULENAME
23 # if defined(US_MODULE_NAME)
24 # define MITKLOG_STR_(x) #x
25 # define MITKLOG_STR(x) MITKLOG_STR_(x)
26 # define MITKLOG_MODULENAME MITKLOG_STR(US_MODULE_NAME)
28 # define MITKLOG_MODULENAME "n/a"
72 m_Message(level, filePath, lineNumber, functionName),
73 m_Stream(std::stringstream::out)
83 m_Message.Message = m_Stream.str();
95 std::locale originalLocale = m_Stream.getloc();
100 m_Stream.imbue(originalLocale);
112 std::locale originalLocale = m_Stream.getloc();
117 m_Stream.imbue(originalLocale);
128 std::locale originalLocale = m_Stream.getloc();
133 m_Stream.imbue(originalLocale);
147 if (m_Message.Category.length())
148 m_Message.Category +=
".";
150 m_Message.Category += category;
162 m_Disabled |= !enabled;
209 #define MITK_INFO mitk::PseudoLogStream(mitk::LogLevel::Info, __FILE__, __LINE__, __FUNCTION__)
210 #define MITK_WARN mitk::PseudoLogStream(mitk::LogLevel::Warn, __FILE__, __LINE__, __FUNCTION__)
211 #define MITK_ERROR mitk::PseudoLogStream(mitk::LogLevel::Error, __FILE__, __LINE__, __FUNCTION__)
212 #define MITK_FATAL mitk::PseudoLogStream(mitk::LogLevel::Fatal, __FILE__, __LINE__, __FUNCTION__)
214 #ifdef MITK_ENABLE_DEBUG_MESSAGES
215 #define MITK_DEBUG mitk::PseudoLogStream(mitk::LogLevel::Debug, __FILE__, __LINE__, __FUNCTION__)
217 #define MITK_DEBUG true ? mitk::NullLogStream() : mitk::NullLogStream()
NullLogStream & operator<<(std::ostream &(*)(std::ostream &))
std::stringstream m_Stream
LogLevel
Message/event levels of the MITK log mechanism.
NullLogStream & operator<<(const T &)
PseudoLogStream & operator<<(T &data)
Simulates a std::cout stream but does nothing.
Simulates a std::cout stream.
void MITKLOG_EXPORT EnableBackends(LogBackendBase::OutputType type)
Enable the output of a backend.
A single log message (log event) of the MITK log mechanism.
PseudoLogStream & operator<<(std::ostream &(*func)(std::ostream &))
Find image slices visible on a given plane.
~PseudoLogStream()
The encapsulated message is written to the backend.
void MITKLOG_EXPORT RegisterBackend(LogBackendBase *backend)
Register a backend in the MITK log mechanism.
NullLogStream & operator<<(T &)
PseudoLogStream & operator()(bool enabled)
Enables/disables the PseudoLogStream.
#define MITKLOG_MODULENAME
void MITKLOG_EXPORT DistributeToBackends(LogMessage &message)
Distribute the given message to all registered backends.
PseudoLogStream & operator<<(const T &data)
bool MITKLOG_EXPORT IsBackendEnabled(LogBackendBase::OutputType type)
Check whether the output of this backend is enabled.
NullLogStream & operator()(const char *)
NullLogStream & operator()(bool)
void MITKLOG_EXPORT UnregisterBackend(LogBackendBase *backend)
Unregister a backend.
void MITKLOG_EXPORT DisableBackends(LogBackendBase::OutputType type)
Disable the output of a backend.
PseudoLogStream & operator()(const std::string &category)
Sets the category of this PseudoLogStream object.
PseudoLogStream(LogLevel level, const std::string &filePath, int lineNumber, const std::string &functionName)