|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Abstract interface for log backends that can be registered in the MITK log mechanism. More...
#include <mitkLogBackendBase.h>

Public Types | |
| enum class | OutputType { Console , File , Other } |
| Classification of the output destination of a backend. More... | |
Public Member Functions | |
| virtual | ~LogBackendBase () |
| virtual void | ProcessMessage (const LogMessage &message)=0 |
| Process a log message. More... | |
| virtual OutputType | GetOutputType () const =0 |
| Return the output type of this backend. More... | |
Abstract interface for log backends that can be registered in the MITK log mechanism.
Subclasses implement ProcessMessage() to handle log events (e.g. writing to console, file, or a remote logging service). Backends are registered and unregistered via mitk::RegisterBackend() and mitk::UnregisterBackend(). Backends of a given OutputType can be collectively enabled or disabled via EnableBackends() / DisableBackends().
If no backend is registered when a log message is emitted, a default LogBackendCout instance is created automatically. This default backend is removed as soon as a user-registered backend is added.
Definition at line 34 of file mitkLogBackendBase.h.
|
strong |
Classification of the output destination of a backend.
Used by EnableBackends() / DisableBackends() to selectively enable or disable groups of backends by their output type.
| Enumerator | |
|---|---|
| Console | Backend writes to the console (stdout/stderr). |
| File | Backend writes to a file. |
| Other | Backend writes to another destination (e.g. network, GUI widget). |
Definition at line 42 of file mitkLogBackendBase.h.
|
virtual |
|
pure virtual |
Return the output type of this backend.
Used by the log mechanism to determine whether this backend is enabled.
Implemented in mitk::LogBackendCout, and mitk::LogBackend.
|
pure virtual |
Process a log message.
Called by the MITK log mechanism for each registered and enabled backend whenever a log message is emitted. Implementations should format and output the message according to their destination.
| [in] | message | The log message to process. The message text has already been trimmed of trailing whitespace. |
Implemented in mitk::LogBackendText, mitk::LogBackendCout, and mitk::LogBackend.