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"
24
25#include <map>
26
27
28namespace itk
29{
30
31class OutputWindow;
32
33namespace simple
34{
35
36class ITKLogger;
37
49{
50public:
51 LoggerBase() = default;
52
53 ~LoggerBase() override;
54
55 virtual void
56 DisplayText(const char * t)
57#ifndef SWIGR
58 = 0
59#endif
60 ;
61
62 virtual void
63 DisplayErrorText(const char * t);
64
65 virtual void
66 DisplayWarningText(const char * t);
67
68 virtual void
69 DisplayGenericOutputText(const char * t);
70
71 virtual void
72 DisplayDebugText(const char * t);
73
74 std::string
75 GetName() const override;
76 void
77 SetName(const std::string & n) override;
78
87 virtual ITKLogger
89
94 static ITKLogger
96};
97
98#if defined(SWIG)
99# define SITK_FINAL
100#else
101# define SITK_FINAL final
102#endif
103
111{
112public:
114 ~ITKLogger() override;
115
116 ITKLogger() = default;
119
120 void
121 DisplayText(const char * t) override;
122
123 void
124 DisplayErrorText(const char * t) override;
125
126 void
127 DisplayWarningText(const char * t) override;
128
129 void
130 DisplayGenericOutputText(const char * t) override;
131
132 void
133 DisplayDebugText(const char * t) override;
134
143
144
145private:
147};
148
149} // namespace simple
150} // namespace itk
151
152#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 *)
itk::OutputWindow * m_OutputWindow
Definition sitkLogger.h:146
void DisplayDebugText(const char *t) override
void DisplayWarningText(const char *t) override
void DisplayErrorText(const char *t) override
void DisplayText(const char *t) override
ITKLogger & operator=(ITKLogger)
ITKLogger SetAsGlobalITKLogger() override
ITKLogger(const ITKLogger &)
#define SITKCommon_EXPORT
Definition sitkCommon.h:41