OSFI-C++  3.10.0
OpenSF Integration Library
Logger.h
Go to the documentation of this file.
1 /*
2  * openSF Integration Libraries (OSFI)
3  * Deimos Space, S.L.U.
4  *
5  * This file is part of OSFI. OSFI is free software; you can redistribute it
6  * and/or modify it under the terms of the 'ESA Software Community Licence Permissive' as
7  * published by the European Space Agency; either version 2.4 of the License,
8  * or (at your option) any later version. You should have received a
9  * copy of the 'ESA Software Community Licence Permissive - v2.4' along with this program
10  * or one can be found at <http://eop-cfi.esa.int/index.php/docs-and-mission-data/licensing-documents>.
11  */
12 
17 #ifndef LOGGER
18 #define LOGGER
19 
20 #include <string>
21 #include <iostream>
22 
23 using namespace std;
24 
25 #if __cplusplus >= 201103L
27  #define OSFI_NO_RETURN [[noreturn]]
28 #else
29  #define OSFI_NO_RETURN /* nothing */
30 #endif
31 
65 class Logger
66 {
67 public:
68 
73  static void error(const string& message);
74 
79  static void warning(const string& message);
80 
85  static void info(const string& message);
86 
94  static void debug(const string& message);
95 
100  static ostream & getErrorStream();
101 
108  static ostream & getDebugStream();
109 
114  static ostream & getInfoStream();
115 
120  static ostream & getWarningStream();
121 
127  static void progress(int step, int nSteps);
128 
135  OSFI_NO_RETURN static void finishExecution(int errorCode);
136 
142  static void qualityReport(const string& name, double value);
143 
149  static void qualityReport(const string& name, const string& value);
150 
155  static ostream & getQualityStream();
156 
160  bool static isDebugging();
161 
171  bool static isColored();
172 
173 private:
174 
178  static bool debugging;
179 
183  static bool colored;
184 
188  static const char delimitier;
189 
193  static const char * fileName;
194 
195 };
196 
197 #endif // LOGGER
#define OSFI_NO_RETURN
Definition: Logger.h:27
Definition: Logger.h:66
static void debug(const string &message)
static bool isDebugging()
static ostream & getQualityStream()
static void finishExecution(int errorCode)
static void info(const string &message)
static void qualityReport(const string &name, const string &value)
static ostream & getWarningStream()
static void error(const string &message)
static void qualityReport(const string &name, double value)
static void warning(const string &message)
static ostream & getDebugStream()
static ostream & getInfoStream()
static bool isColored()
static ostream & getErrorStream()
static void progress(int step, int nSteps)