Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkLogBackend.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
21 #ifndef mitkLogBackend_h
22 #define mitkLogBackend_h
23 
24 #include <mitkLogBackendText.h>
25 #include <MitkCoreExports.h>
26 
27 namespace mitk
28 {
32  {
33  public:
39  void ProcessMessage(const LogMessage&) override;
40 
43  static void Register();
44 
47  static void Unregister();
48 
51  static void SetLogFile(const std::string& file);
52 
76  static void RotateLogFiles(const std::string& prefixPath);
77 
96  static std::string IncrementLogFileNames(const std::string& prefixPath, int numLogFiles = 10);
97 
100  static std::string GetLogFile();
101 
106  static void EnableAdditionalConsoleWindow(bool enable);
107 
111  static void CatchLogFileCommandLineParameter(int& argc, char** argv);
112 
118 
119  protected:
124  static bool CheckIfFileExists(const std::string &filename);
125  };
126 }
127 
128 #endif
#define MITKCORE_EXPORT
OutputType
Classification of the output destination of a backend.
Abstract superclass for text-based log backends.
Log backend implementation for MITK.
static bool CheckIfFileExists(const std::string &filename)
Check if a file exists.
static void CatchLogFileCommandLineParameter(int &argc, char **argv)
Automatically extract and remove the "--logfile <file>" parameters from the standard C main parameter...
static void SetLogFile(const std::string &file)
Set extra log file path in addition to the console log.
static std::string IncrementLogFileNames(const std::string &prefixPath, int numLogFiles=10)
Increment the names of logfiles with the given prefixPath.
void ProcessMessage(const LogMessage &) override
Process and output a single log message.
static void Register()
Registers MITK log backend.
static std::string GetLogFile()
static void RotateLogFiles(const std::string &prefixPath)
Activates and handles a rolling log file with the given prefix and path.
static void Unregister()
Unregister MITK log backend.
static void EnableAdditionalConsoleWindow(bool enable)
Enable an additional logging output window by means of itk::OutputWindow.
LogBackendBase::OutputType GetOutputType() const override
Return the output type of this backend.
Find image slices visible on a given plane.
A single log message (log event) of the MITK log mechanism.