Main MRPT website > C++ reference for MRPT 1.5.7
COutputLogger.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 #ifndef COUTPUTLOGGER_H
11 #define COUTPUTLOGGER_H
12 
13 #include <mrpt/base/link_pragmas.h>
14 #include <mrpt/utils/mrpt_macros.h>
15 #include <mrpt/utils/TEnumType.h>
16 #include <mrpt/system/os.h> // for console color constants
17 #include <mrpt/utils/CTicTac.h>
18 
19 #include <string>
20 #include <deque>
21 #include <mrpt/system/datetime.h>
22 #include <sstream>
23 #include <set>
24 
25 namespace mrpt {
26  namespace utils {
27  class CStream; // frwd decl
28 
29  /** \brief Enumeration of available verbosity levels. \sa COutputLogger */
30  enum VerbosityLevel {
31  LVL_DEBUG = 0,
32  LVL_INFO,
33  LVL_WARN,
34  LVL_ERROR,
35  // ------------
36  NUMBER_OF_VERBOSITY_LEVELS
37  };
38 
39  /** Callback types for use with mrpt::utils::COuputLogger */
40  typedef void(*output_logger_callback_t)(const std::string &msg, const mrpt::utils::VerbosityLevel level, const std::string &loggerName, const mrpt::system::TTimeStamp timestamp, void *userParam);
41 
42  /** \brief Versatile class for consistent logging and
43  * management of output messages
44  *
45  * COutputLogger is a versatile class for logging messages either to the
46  * terminal window or to an external file. Class instances can take messages in
47  * std::string using the logStr class methods. The following macros are also provided
48  * for usage within a class that inherits from COutputLogger:
49  *
50  * \code
51  * // Plain strings:
52  * MRPT_LOG_DEBUG("This will be shown only if verbosity level is LVL_DEBUG.");
53  * MRPT_LOG_ERROR("This message will be always shown.");
54  * // printf-like versions:
55  * MRPT_LOG_ERROR_FMT("Out of range value: %i.", int_param);
56  * // stream-like versions:
57  * MRPT_LOG_ERROR_STREAM("Out of range value: " << int_param << " more vars: " << other_var);
58  * // Minimum period (in seconds) between messages:
59  * MRPT_LOG_THROTTLE_DEBUG_STREAM(5.0, "Var=" << value << " foo=" << foo_var);
60  * // Only once:
61  * MRPT_LOG_ONCE_WARN("Notice: blah blah");
62  * \endcode
63  *
64  * From outside of a class inheriting from COutputLogger the following `MRPT_UNSCOPED_{START|END}` macros are provided:
65  *
66  * \code
67  * MRPT_UNSCOPED_LOGGER_START;
68  * MRPT_LOG_WARN("blah");
69  * MRPT_LOG_ERROR_STREAM("error: " << strval);
70  * MRPT_UNSCOPED_LOGGER_END;
71  * \endcode
72  *
73  * - Logger instance keeps the messages in an internal container so that upon
74  * request it can dump them either to the console or to an external file
75  * altogether.
76  * - The message, when printed in the terminal window, is **colored** according to
77  * the logger's current verbosity/logging level (Logging level with which
78  * the underlying TMsg instance was instantiatedd). The available verbosity
79  * levels as well as their corresponding colors are listed below:
80  *
81  * + LVL_DEBUG => CONCOL_BLUE
82  * + LVL_INFO => CONCOL_NORMAL
83  * + LVL_WARN => CONCOL_GREEN
84  * + LVL_ERROR => CONCOL_RED
85  *
86  * - Logged messages are displayed in the screen if the current logger level is
87  * higher than m_min_verbosity_level (logger ignores those messages
88  * altogether). This can be used for filtering the output messages according
89  * to their importance (e.g. show only error messages by issuing
90  * setMinLoggingLevel(LVL_ERROR)).
91  * \sa setLoggingLevel, setMinLoggingLevel
92  *
93  * Default logging level is LVL_INFO.
94  *
95  * User may receive callbacks whenever a message is displayed to console by using
96  * logRegisterCallback(). If for some reason the callbacks are not needed any more,
97  * use logDeregisterCallback() to stop receiving calls. This mechanism is useful
98  * in case of showing the messages to a GUI, transmiting them to a remote machine, etc.
99  *
100  * \note By default every logged message is going to be dumped to the standard
101  * output as well (if VerbosityLevel > m_min_verbosity_level). Unset \b
102  * logging_enable_console_output class variable if that's not the desired
103  * behavior
104  *
105  * \note [New in MRPT 1.5.0]
106  * \sa TMsg
107  * \ingroup mrpt_base_grp
108  */
109  class BASE_IMPEXP COutputLogger {
110  public:
111  static mrpt::system::TConsoleColor logging_levels_to_colors[NUMBER_OF_VERBOSITY_LEVELS]; //! Map from VerbosityLevels to their corresponding mrpt::system::TConsoleColor. Handy for coloring the input based on the verbosity of the message
112  static std::string logging_levels_to_names[NUMBER_OF_VERBOSITY_LEVELS]; //!< Map from VerbosityLevels to their corresponding names. Handy for printing the current message VerbosityLevel along with the actual content
113 
114  /** @name Logging methods
115  * @{ */
116 
117  /**
118  * \brief Construct a COutputLogger instance with the given name as the
119  * instance name.
120  *
121  * Call to this constructor can be used instead of first initializing the
122  * object and then explicitly setting the name like in the following case:
123  * \code
124  * COutputLogger a_logger;
125  * a_logger.setLoggerName("logger_name");
126  * \endcode
127  */
128  COutputLogger(const std::string &name);
129  COutputLogger(); //!< Default class constructor. Name of the logger is initialized to "logStr"
130  virtual ~COutputLogger(); //!< virtual dtor (so we can derive classes from this one)
131 
132  /** \brief Main method to add the specified message string to the logger.
133  * \sa logCond, logFmt */
134  void logStr(const VerbosityLevel level, const std::string& msg_str) const; // renamed from log() to avoid conflict with math ::log()
135 
136  /** \brief Alternative logging method, which mimics the printf behavior.
137  *
138  * Handy for not having to first use mrpt::format to pass a std::string
139  * message to logStr
140  *
141  * \code
142  * // instead of:
143  * logStr(mrpt::format("Today is the %d of %s, %d", 15, "July", 2016));
144  *
145  * // one can use:
146  * logFmt("Today is the %d of %s, %d", 15, "July", 2016);
147  * \endcode
148  *
149  * \sa logStr, logCond
150  */
151  void logFmt(const VerbosityLevel level, const char* fmt, ...) const MRPT_printf_format_check(3, 4); // arg 1=this
152 
153  /** \brief Log the given message only if the condition is satisfied.
154  *
155  * \sa log, logFmt
156  */
157  void logCond(const VerbosityLevel level, bool cond, const std::string& msg_str) const;
158 
159  void setLoggerName(const std::string& name); //!< Set the name of the COutputLogger instance. \sa getLoggerName
160  std::string getLoggerName() const; //!< Return the name of the COutputLogger instance. \sa setLoggerName
161 
162  /** \brief Set the *minimum* logging level for which the incoming logs are going to be taken into account.
163  *
164  * String messages with specified VerbosityLevel smaller than the min, will
165  * not be outputted to the screen and neither will a record of them be
166  * stored in by the COutputLogger instance
167  */
168  void setMinLoggingLevel(const VerbosityLevel level);
169  /** alias of setMinLoggingLevel() */
170  void setVerbosityLevel(const VerbosityLevel level);
171 
172  /** \sa setMinLoggingLevel */
173  VerbosityLevel getMinLoggingLevel() const { return m_min_verbosity_level; }
174  bool isLoggingLevelVisible(VerbosityLevel level) const { return m_min_verbosity_level <= level; }
175 
176  void getLogAsString(std::string& log_contents) const; //!< Fill the provided string with the contents of the logger's history in std::string representation
177  std::string getLogAsString() const; //!< Get the history of COutputLogger instance in a string representation.
178 
179  /** \brief Write the contents of the COutputLogger instance to an external file.
180  *
181  * Upon call to this method, COutputLogger dumps the contents of all the
182  * logged commands so far to the specified external file. By default the
183  * filename is set to ${LOGGERNAME}.log except if the fname parameter is
184  * provided
185  *
186  * \sa dumpToConsole, getAsString
187  */
188  void writeLogToFile(const std::string* fname_in = NULL) const;
189  /** \brief Dump the current contents of the COutputLogger instance in the
190  * terminal window.
191  *
192  * \sa writeToFile
193  */
194  void dumpLogToConsole() const;
195  std::string getLoggerLastMsg() const; //!< Return the last Tmsg instance registered in the logger history
196  void getLoggerLastMsg(std::string& msg_str) const; //!< Fill inputtted string with the contents of the last message in history
197  void loggerReset(); //!< Reset the contents of the logger instance. Called upon construction.
198 
199  bool logging_enable_console_output; //!< [Default=true] Set it to false in case you don't want the logged messages to be dumped to the output automatically.
200  bool logging_enable_keep_record; //!< [Default=false] Enables storing all messages into an internal list. \sa writeLogToFile, getLogAsString
201 
202  void logRegisterCallback(output_logger_callback_t userFunc, void *userParam = NULL);
203  void logDeregisterCallback(output_logger_callback_t userFunc, void *userParam = NULL);
204  /** @} */
205 
206  struct BASE_IMPEXP TCallbackEntry
207  {
208  output_logger_callback_t func;
209  void *userParam;
210 
211  bool operator <(const mrpt::utils::COutputLogger::TCallbackEntry &e2) const {
212  return func < e2.func;
213  }
214  bool operator == (const mrpt::utils::COutputLogger::TCallbackEntry &c2) const {
215  return func == c2.func && userParam == c2.userParam;
216  }
217 
218  };
219 
220  protected:
221  /** \brief Provided messages with VerbosityLevel smaller than this value shall be ignored */
222  VerbosityLevel m_min_verbosity_level;
223  private:
224  /**
225  * \brief Struct responsible of holding information relevant to the message
226  * (in std::string form) issued by the user.
227  *
228  * Upon TMsg initialization, instance fetches the name of the caller
229  * COutputLogger, as well as the VerbosityLevel and the
230  * mrpt::system::TTimeStamp of the message provided.
231  * The format of the message when this is printed / or written to an
232  * external file complies is given below:
233  *
234  * <center><em> [name | level | timestamp:] body </em></center>
235  */
236  struct BASE_IMPEXP TMsg {
237  /** \brief Class constructor that passes a message in std::string
238  * form as well as a reference to the COutputLogger that provided the
239  * current message
240  */
241  TMsg(const mrpt::utils::VerbosityLevel level, const std::string& msg, const COutputLogger& logger);
242  /** \brief Default Destructor */
243  ~TMsg();
244 
245  /** \brief Return a string representation of the underlying message */
246  std::string getAsString() const;
247  /** \brief Fill the string with the contents of the underlying message in
248  * string representation */
249  void getAsString(std::string* contents) const;
250  /** \brief Write the message contents to the specified stream
251  *
252  * \sa getAsString
253  */
254  void writeToStream(mrpt::utils::CStream& out) const;
255  /** \brief Dump the message contents to the standard output
256  *
257  * \sa writeToStream
258  */
259  void dumpToConsole() const;
260  /** \brief Reset the contents of the TMsg instance */
261  void reset();
262 
263  // parameters of the message under construction
264  mrpt::system::TTimeStamp timestamp; /**< Timestamp of the message. */
265  VerbosityLevel level; /**< Verbosity level of the message. */
266  std::string name; /**< Name of the COutputLogger instance that called registered the message. */
267  std::string body; /**< Actual content of the message. */
268  };
269 
270  std::string generateStringFromFormat(const char* fmt, va_list argp) const; //!< Helper method for generating a std::string instance from printf-like arguments
271 
272  std::string m_logger_name;
273  mutable std::deque<TMsg> m_history; // deque is better than vector to avoid memory reallocs
274 
275  std::set<TCallbackEntry> m_listCallbacks;
276  };
277 
278  /** For use in MRPT_LOG_DEBUG_STREAM(), etc. */
279  struct BASE_IMPEXP COutputLoggerStreamWrapper
280  {
281  COutputLoggerStreamWrapper(VerbosityLevel level, const COutputLogger &logger) : m_level(level), m_logger(logger) {}
282  ~COutputLoggerStreamWrapper() { if (m_logger.isLoggingLevelVisible(m_level)) m_logger.logStr(m_level, m_str.str()); }
283 
284  template <typename T>
285  std::stringstream & operator << (const T &val) {
286  m_str << val;
287  return m_str;
288  }
289  // Overload for std::stringstream objects
290  std::stringstream & operator << (const std::stringstream &val) {
291  m_str << val.str();
292  return m_str;
293  }
294 
295  private:
296  std::stringstream m_str;
297  VerbosityLevel m_level;
298  const COutputLogger &m_logger;
299  };
300 
301 #define INTERNAL_MRPT_LOG(_LVL,_STRING) \
302  this->logStr(_LVL, _STRING)
303 
304 #define INTERNAL_MRPT_LOG_ONCE(_LVL, _STRING) \
305  do { \
306  static once_flag = false; \
307  if (!once_flag) { \
308  once_flag = true; \
309  this->logStr(_LVL, _STRING); \
310  } } while (0)
311 
312 #define INTERNAL_MRPT_LOG_FMT(_LVL,_FMT_STRING,...) \
313  do { \
314  if (this->isLoggingLevelVisible(_LVL)) { \
315  this->logFmt(_LVL, _FMT_STRING, __VA_ARGS__); \
316  } } while (0)
317 
318 #define INTERNAL_MRPT_LOG_STREAM(_LVL, __CONTENTS) \
319  do { \
320  if (this->isLoggingLevelVisible(_LVL)) { \
321  ::mrpt::utils::COutputLoggerStreamWrapper(_LVL, *this) << __CONTENTS; \
322  } } while (0)
323 
324 #define INTERNAL_MRPT_LOG_THROTTLE(_LVL,_PERIOD_SECONDS, _STRING) \
325  do { \
326  if (this->isLoggingLevelVisible(_LVL)) { \
327  static mrpt::utils::CTicTac tim; \
328  if (tim.Tac()>_PERIOD_SECONDS) { \
329  tim.Tic(); \
330  this->logStr(_LVL, _STRING); \
331  } } } while (0)
332 
333 #define INTERNAL_MRPT_LOG_THROTTLE_STREAM(_LVL,_PERIOD_SECONDS, __CONTENTS) \
334  do { \
335  if (this->isLoggingLevelVisible(_LVL)) { \
336  static mrpt::utils::CTicTac tim; \
337  if (tim.Tac()>_PERIOD_SECONDS) { \
338  tim.Tic(); \
339  ::mrpt::utils::COutputLoggerStreamWrapper(_LVL, *this) << __CONTENTS; \
340  } } } while (0)
341 
342 #define INTERNAL_MRPT_LOG_THROTTLE_FMT(_LVL,_PERIOD_SECONDS,_FMT_STRING,...) \
343  do { \
344  if (this->isLoggingLevelVisible(_LVL)) { \
345  static mrpt::utils::CTicTac tim; \
346  if (tim.Tac()>_PERIOD_SECONDS) { \
347  tim.Tic(); \
348  this->logFmt(_LVL, _FMT_STRING, __VA_ARGS__); \
349  } } } while (0)
350 
351 
352  /** Use: `MRPT_LOG_DEBUG("message");` */
353 #define MRPT_LOG_DEBUG(_STRING) INTERNAL_MRPT_LOG(::mrpt::utils::LVL_DEBUG, _STRING)
354 #define MRPT_LOG_INFO( _STRING) INTERNAL_MRPT_LOG(::mrpt::utils::LVL_INFO, _STRING)
355 #define MRPT_LOG_WARN( _STRING) INTERNAL_MRPT_LOG(::mrpt::utils::LVL_WARN, _STRING)
356 #define MRPT_LOG_ERROR(_STRING) INTERNAL_MRPT_LOG(::mrpt::utils::LVL_ERROR, _STRING)
357 
358 /** Use: `MRPT_LOG_ONCE_DEBUG("once-only message");` */
359 #define MRPT_LOG_ONCE_DEBUG(_STRING) INTERNAL_MRPT_LOG_ONCE(::mrpt::utils::LVL_DEBUG, _STRING)
360 #define MRPT_LOG_ONCE_INFO( _STRING) INTERNAL_MRPT_LOG_ONCE(::mrpt::utils::LVL_INFO, _STRING)
361 #define MRPT_LOG_ONCE_WARN( _STRING) INTERNAL_MRPT_LOG_ONCE(::mrpt::utils::LVL_WARN, _STRING)
362 #define MRPT_LOG_ONCE_ERROR(_STRING) INTERNAL_MRPT_LOG_ONCE(::mrpt::utils::LVL_ERROR, _STRING)
363 
364 /** Use: `MRPT_LOG_THROTTLE_DEBUG(5.0, "message");` */
365 #define MRPT_LOG_THROTTLE_DEBUG(_PERIOD_SECONDS,_STRING) INTERNAL_MRPT_LOG_THROTTLE(::mrpt::utils::LVL_DEBUG,_PERIOD_SECONDS, _STRING)
366 #define MRPT_LOG_THROTTLE_INFO( _PERIOD_SECONDS,_STRING) INTERNAL_MRPT_LOG_THROTTLE(::mrpt::utils::LVL_INFO, _PERIOD_SECONDS, _STRING)
367 #define MRPT_LOG_THROTTLE_WARN( _PERIOD_SECONDS,_STRING) INTERNAL_MRPT_LOG_THROTTLE(::mrpt::utils::LVL_WARN, _PERIOD_SECONDS, _STRING)
368 #define MRPT_LOG_THROTTLE_ERROR(_PERIOD_SECONDS,_STRING) INTERNAL_MRPT_LOG_THROTTLE(::mrpt::utils::LVL_ERROR,_PERIOD_SECONDS, _STRING)
369 
370 /** Use: `MRPT_LOG_DEBUG_FMT("i=%u", i);` */
371 #define MRPT_LOG_DEBUG_FMT(_FMT_STRING,...) INTERNAL_MRPT_LOG_FMT(::mrpt::utils::LVL_DEBUG, _FMT_STRING, __VA_ARGS__)
372 #define MRPT_LOG_INFO_FMT( _FMT_STRING,...) INTERNAL_MRPT_LOG_FMT(::mrpt::utils::LVL_INFO, _FMT_STRING, __VA_ARGS__)
373 #define MRPT_LOG_WARN_FMT( _FMT_STRING,...) INTERNAL_MRPT_LOG_FMT(::mrpt::utils::LVL_WARN, _FMT_STRING, __VA_ARGS__)
374 #define MRPT_LOG_ERROR_FMT(_FMT_STRING,...) INTERNAL_MRPT_LOG_FMT(::mrpt::utils::LVL_ERROR, _FMT_STRING, __VA_ARGS__)
375 
376 /** Use: `MRPT_LOG_DEBUG_STREAM("Var=" << value << " foo=" << foo_var);` */
377 #define MRPT_LOG_DEBUG_STREAM(__CONTENTS) INTERNAL_MRPT_LOG_STREAM(::mrpt::utils::LVL_DEBUG,__CONTENTS)
378 #define MRPT_LOG_INFO_STREAM( __CONTENTS) INTERNAL_MRPT_LOG_STREAM(::mrpt::utils::LVL_INFO, __CONTENTS)
379 #define MRPT_LOG_WARN_STREAM( __CONTENTS) INTERNAL_MRPT_LOG_STREAM(::mrpt::utils::LVL_WARN, __CONTENTS)
380 #define MRPT_LOG_ERROR_STREAM(__CONTENTS) INTERNAL_MRPT_LOG_STREAM(::mrpt::utils::LVL_ERROR,__CONTENTS)
381 
382 /** Usage: `MRPT_LOG_THROTTLE_DEBUG_STREAM(5.0, "Var=" << value << " foo=" << foo_var);` */
383 #define MRPT_LOG_THROTTLE_DEBUG_STREAM(_PERIOD_SECONDS,__CONTENTS) INTERNAL_MRPT_LOG_THROTTLE_STREAM(::mrpt::utils::LVL_DEBUG,_PERIOD_SECONDS,__CONTENTS)
384 #define MRPT_LOG_THROTTLE_INFO_STREAM( _PERIOD_SECONDS,__CONTENTS) INTERNAL_MRPT_LOG_THROTTLE_STREAM(::mrpt::utils::LVL_INFO, _PERIOD_SECONDS,__CONTENTS)
385 #define MRPT_LOG_THROTTLE_WARN_STREAM( _PERIOD_SECONDS,__CONTENTS) INTERNAL_MRPT_LOG_THROTTLE_STREAM(::mrpt::utils::LVL_WARN, _PERIOD_SECONDS,__CONTENTS)
386 #define MRPT_LOG_THROTTLE_ERROR_STREAM(_PERIOD_SECONDS,__CONTENTS) INTERNAL_MRPT_LOG_THROTTLE_STREAM(::mrpt::utils::LVL_ERROR,_PERIOD_SECONDS,__CONTENTS)
387 
388 /** Usage: `MRPT_LOG_THROTTLE_DEBUG_FMT(5.0, "i=%u", i);` */
389 #define MRPT_LOG_THROTTLE_DEBUG_FMT(_PERIOD_SECONDS,_FMT_STRING,...) INTERNAL_MRPT_LOG_THROTTLE_FMT(::mrpt::utils::LVL_DEBUG,_PERIOD_SECONDS, _FMT_STRING, __VA_ARGS__)
390 #define MRPT_LOG_THROTTLE_INFO_FMT( _PERIOD_SECONDS,_FMT_STRING,...) INTERNAL_MRPT_LOG_THROTTLE_FMT(::mrpt::utils::LVL_INFO, _PERIOD_SECONDS, _FMT_STRING, __VA_ARGS__)
391 #define MRPT_LOG_THROTTLE_WARN_FMT( _PERIOD_SECONDS,_FMT_STRING,...) INTERNAL_MRPT_LOG_THROTTLE_FMT(::mrpt::utils::LVL_WARN, _PERIOD_SECONDS, _FMT_STRING, __VA_ARGS__)
392 #define MRPT_LOG_THROTTLE_ERROR_FMT(_PERIOD_SECONDS,_FMT_STRING,...) INTERNAL_MRPT_LOG_THROTTLE_FMT(::mrpt::utils::LVL_ERROR,_PERIOD_SECONDS, _FMT_STRING, __VA_ARGS__)
393 
394 
395 #ifdef _DEBUG
396 # define DEFAULT_LOGLVL_MRPT_UNSCOPED ::mrpt::utils::LVL_DEBUG
397 #else
398 # define DEFAULT_LOGLVL_MRPT_UNSCOPED ::mrpt::utils::LVL_DEBUG
399 #endif
400 
401 /** For calling any `MRPT_LOG_*()` macro from outside of an object inherited from COutputLogger.
402  * Debug level is `DEBUG` if build with `_DEBUG` preprocessor flag, `INFO` otherwise.
403  * Use:
404  * \code
405  * MRPT_UNSCOPED_LOGGER_START;
406  * MRPT_LOG_WARN("blah");
407  * MRPT_LOG_ERROR_STREAM("error: " << strval);
408  * MRPT_UNSCOPED_LOGGER_END;
409  */
410  #define MRPT_UNSCOPED_LOGGER_START \
411  do { \
412  struct dummy_logger_ : public mrpt::utils::COutputLogger { \
413  dummy_logger_() : mrpt::utils::COutputLogger("MRPT_log") { \
414  this->setMinLoggingLevel(DEFAULT_LOGLVL_MRPT_UNSCOPED); \
415  } \
416  void usercode() { \
417  do {} while (0) \
418  // Here comes the user code, which is run in the ctor, and will call the object log methods.
419 
420  #define MRPT_UNSCOPED_LOGGER_END \
421  } \
422  }; \
423  static dummy_logger_ tmp_obj; \
424  tmp_obj.usercode(); \
425  } while (0)
426 
427  }
428  // Specializations MUST occur at the same namespace:
429  namespace utils
430  {
431  template <>
432  struct TEnumTypeFiller<mrpt::utils::VerbosityLevel>
433  {
434  typedef mrpt::utils::VerbosityLevel enum_t;
435  static void fill(bimap<enum_t,std::string> &m_map)
436  {
437  using namespace mrpt::utils;
438  m_map.insert(LVL_DEBUG, "DEBUG");
439  m_map.insert(LVL_DEBUG, "LVL_DEBUG");
440  m_map.insert(LVL_INFO , "INFO");
441  m_map.insert(LVL_INFO , "LVL_INFO");
442  m_map.insert(LVL_WARN , "WARN");
443  m_map.insert(LVL_WARN , "LVL_WARN");
444  m_map.insert(LVL_ERROR, "ERROR");
445  m_map.insert(LVL_ERROR, "LVL_ERROR");
446  }
447  };
448  } // End of namespace
449 }
450 #endif /* end of include guard: COUTPUTLOGGER_H */
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
Definition: datetime.h:30
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
static void fill(mrpt::utils::bimap< enum_t, std::string > &m_map)
STL namespace.
#define MRPT_printf_format_check(_FMT_, _VARARGS_)
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
bool operator<(const CArray< T, N > &x, const CArray< T, N > &y)
Definition: CArray.h:281
int val
Definition: mrpt_jpeglib.h:953
TConsoleColor
For use in setConsoleColor.
Definition: os.h:158
CStream BASE_IMPEXP & operator<<(mrpt::utils::CStream &s, const char *a)
Definition: CStream.cpp:130
GLsizei const GLchar ** string
Definition: glext.h:3919
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLboolean reset
Definition: glext.h:3535
GLint level
Definition: glext.h:3545
GLuint const GLchar * name
Definition: glext.h:3891
bool operator==(const CArray< T, N > &x, const CArray< T, N > &y)
Definition: CArray.h:277
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019