OTB  7.1.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 {
32 
40 class OTBCommon_EXPORT Logger : public itk::Logger
41 {
42 public:
43  typedef Logger Self;
44  typedef itk::Logger Superclass;
45  typedef itk::SmartPointer<Self> Pointer;
46  typedef itk::SmartPointer<const Self> ConstPointer;
47 
48  itkTypeMacro(Logger, itk::Logger);
49 
58  static Logger* Instance();
59 
60  void ResetOutputs();
61 
62  static Pointer New();
63  itkCreateAnotherMacro(Logger) itkCloneMacro(Logger)
64 
65 
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 
89 
90 }; // class Logger
91 
92 } // namespace otb
93 
94 #endif // otbLogger_h
itk::SmartPointer< Self > Pointer
Definition: otbLogger.h:45
itk::SmartPointer< const Self > ConstPointer
Definition: otbLogger.h:46
An ITK logger specialized for OTB.
Definition: otbLogger.h:40
Logger Self
Definition: otbLogger.h:43
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
itk::Logger Superclass
Definition: otbLogger.h:44
bool m_LogSetupInfoDone
Definition: otbLogger.h:88