OTB  6.7.0
Orfeo Toolbox
otbLogger.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbLogger_h
22 #define otbLogger_h
23 
24 #include <string>
25 
26 #include "itkLoggerBase.h"
27 #include "itkLogger.h"
28 #include "OTBCommonExport.h"
29 
30 namespace otb {
31 
39 class OTBCommon_EXPORT Logger : public itk::Logger
40 {
41 public:
42  typedef Logger Self;
46 
47  itkTypeMacro(Logger, itk::Logger);
48 
57  static Logger * Instance();
58 
59  void ResetOutputs();
60 
61  static Pointer New();
62  itkCreateAnotherMacro( Logger )
63  itkCloneMacro( Logger )
64 
66  void LogSetupInformation();
67 
69  bool IsLogSetupInformationDone();
70 
72  void LogSetupInformationDone();
73 
74  // Overwrite this to provide custom formatting of log entries
75  std::string BuildFormattedEntry(itk::Logger::PriorityLevelType, std::string const&) override;
76 
77 protected:
78  Logger();
79  virtual ~Logger() override = default;
80 
81 private:
82  Logger(const Self &) = delete;
83  void operator =(const Self&) = delete;
84 
85  static Logger * CreateInstance();
86 
87 
88  bool m_LogSetupInfoDone;
89 
90 }; // class Logger
91 
92 } // namespace otb
93 
94 #endif // otbLogger_h
An ITK logger specialized for OTB.
Definition: otbLogger.h:39
itk::SmartPointer< Self > Pointer
Definition: otbLogger.h:44
Logger Self
Definition: otbLogger.h:42
itk::Logger Superclass
Definition: otbLogger.h:43
itk::SmartPointer< const Self > ConstPointer
Definition: otbLogger.h:45