SimpleITK  
sitkLogger.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef sitkLogger_h
19#define sitkLogger_h
20
21
22#include "sitkCommon.h"
23#include "sitkObjectOwnedBase.h"
25
26#include <memory>
27
28
29namespace itk
30{
31
32class OutputWindow;
33
34namespace simple
35{
36
37class ITKLogger;
38
50{
51public:
53
54 ~LoggerBase() override;
55
56 virtual void
57 DisplayText(const char * t)
58#ifndef SWIGR
59 = 0
60#endif
61 ;
62
63 virtual void
64 DisplayErrorText(const char * t);
65
66 virtual void
67 DisplayWarningText(const char * t);
68
69 virtual void
70 DisplayGenericOutputText(const char * t);
71
72 virtual void
73 DisplayDebugText(const char * t);
74
75 std::string
76 GetName() const override;
77 void
78 SetName(const std::string & n) override;
79
88 virtual ITKLogger
90
95 static ITKLogger
97};
98
99#if defined(SWIG)
100# define SITK_FINAL
101#else
102# define SITK_FINAL final
103#endif
104
112{
113public:
115 ~ITKLogger() override;
116
120
121 void
122 DisplayText(const char * t) override;
123
124 void
125 DisplayErrorText(const char * t) override;
126
127 void
128 DisplayWarningText(const char * t) override;
129
130 void
131 DisplayGenericOutputText(const char * t) override;
132
133 void
134 DisplayDebugText(const char * t) override;
135
144
145
146private:
147 std::unique_ptr<itk::OutputWindow, ProcessObjectDeleter> m_OutputWindow;
148};
149
150} // namespace simple
151} // namespace itk
152
153#endif
virtual ITKLogger SetAsGlobalITKLogger()
virtual void DisplayText(const char *t)=0
virtual void DisplayErrorText(const char *t)
virtual void DisplayWarningText(const char *t)
static ITKLogger GetGlobalITKLogger()
virtual void DisplayDebugText(const char *t)
virtual void DisplayGenericOutputText(const char *t)
std::string GetName() const override
void SetName(const std::string &n) override
void DisplayGenericOutputText(const char *t) override
ITKLogger(itk::OutputWindow *)
void DisplayDebugText(const char *t) override
void DisplayWarningText(const char *t) override
void DisplayErrorText(const char *t) override
void DisplayText(const char *t) override
std::unique_ptr< itk::OutputWindow, ProcessObjectDeleter > m_OutputWindow
Definition sitkLogger.h:147
ITKLogger & operator=(ITKLogger)
ITKLogger SetAsGlobalITKLogger() override
ITKLogger(const ITKLogger &)
#define SITKCommon_EXPORT
Definition sitkCommon.h:41