Classes | Macros
ULogger.h File Reference

ULogger class and convenient macros. More...

#include "rtabmap/utilite/utilite_export.h"
#include "rtabmap/utilite/UMutex.h"
#include "rtabmap/utilite/UDestroyer.h"
#include "rtabmap/utilite/UEvent.h"
#include "rtabmap/utilite/UException.h"
#include <stdio.h>
#include <time.h>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stdarg.h>
Include dependency graph for ULogger.h:

Go to the source code of this file.

Classes

class  ULogEvent
 
class  ULogger
 

Macros

#define UASSERT(condition)   if(!(condition)) ULogger::write(ULogger::kFatal, __FILE__, __LINE__, __FUNCTION__, "Condition (%s) not met!", #condition)
 
#define UASSERT_MSG(condition, msg_str)   if(!(condition)) ULogger::write(ULogger::kFatal, __FILE__, __LINE__, __FUNCTION__, "Condition (%s) not met! [%s]", #condition, msg_str)
 
#define UDEBUG(...)   ULOGGER_DEBUG(__VA_ARGS__)
 
#define UERROR(...)   ULOGGER_ERROR(__VA_ARGS__)
 
#define UFATAL(...)   ULOGGER_FATAL(__VA_ARGS__)
 
#define UINFO(...)   ULOGGER_INFO(__VA_ARGS__)
 
#define ULOGGER_DEBUG(...)   ULOGGER_LOG(ULogger::kDebug, __VA_ARGS__)
 
#define ULOGGER_ERROR(...)   ULOGGER_LOG(ULogger::kError, __VA_ARGS__)
 
#define ULOGGER_FATAL(...)   ULOGGER_LOG(ULogger::kFatal, __VA_ARGS__)
 
#define ULOGGER_INFO(...)   ULOGGER_LOG(ULogger::kInfo, __VA_ARGS__)
 
#define ULOGGER_LOG(level, ...)   ULogger::write(level, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
 
#define ULOGGER_WARN(...)   ULOGGER_LOG(ULogger::kWarning, __VA_ARGS__)
 
#define UWARN(...)   ULOGGER_WARN(__VA_ARGS__)
 

Detailed Description

ULogger class and convenient macros.

This contains macros useful for logging a message anywhere in the application. Once the ULogger is set, use these macros like a printf to print debug messages.

Definition in file ULogger.h.

Macro Definition Documentation

◆ UASSERT

#define UASSERT (   condition)    if(!(condition)) ULogger::write(ULogger::kFatal, __FILE__, __LINE__, __FUNCTION__, "Condition (%s) not met!", #condition)

Print a fatal error level message in the logger if condition is not met. The application will exit on fatal error. Format is the same as a printf:

UASSERT(a!=42, "This is a fatal error message with the number %d", 42);

◆ UASSERT_MSG

#define UASSERT_MSG (   condition,
  msg_str 
)    if(!(condition)) ULogger::write(ULogger::kFatal, __FILE__, __LINE__, __FUNCTION__, "Condition (%s) not met! [%s]", #condition, msg_str)

Definition at line 67 of file ULogger.h.

◆ UDEBUG

#define UDEBUG (   ...)    ULOGGER_DEBUG(__VA_ARGS__)

Print a debug level message in the logger. Format is the same as a printf:

UDEBUG("This is a debug message with the number %d", 42);

◆ UERROR

#define UERROR (   ...)    ULOGGER_ERROR(__VA_ARGS__)

Print an error level message in the logger. Format is the same as a printf:

UERROR("This is an error message with the number %d", 42);

◆ UFATAL

#define UFATAL (   ...)    ULOGGER_FATAL(__VA_ARGS__)

Print a fatal error level message in the logger. The application will exit on fatal error. Format is the same as a printf:

UFATAL("This is a fatal error message with the number %d", 42);

◆ UINFO

#define UINFO (   ...)    ULOGGER_INFO(__VA_ARGS__)

Print a information level message in the logger. Format is the same as a printf:

UINFO("This is a information message with the number %d", 42);

◆ ULOGGER_DEBUG

#define ULOGGER_DEBUG (   ...)    ULOGGER_LOG(ULogger::kDebug, __VA_ARGS__)

Definition at line 53 of file ULogger.h.

◆ ULOGGER_ERROR

#define ULOGGER_ERROR (   ...)    ULOGGER_LOG(ULogger::kError, __VA_ARGS__)

Definition at line 56 of file ULogger.h.

◆ ULOGGER_FATAL

#define ULOGGER_FATAL (   ...)    ULOGGER_LOG(ULogger::kFatal, __VA_ARGS__)

Definition at line 57 of file ULogger.h.

◆ ULOGGER_INFO

#define ULOGGER_INFO (   ...)    ULOGGER_LOG(ULogger::kInfo, __VA_ARGS__)

Definition at line 54 of file ULogger.h.

◆ ULOGGER_LOG

#define ULOGGER_LOG (   level,
  ... 
)    ULogger::write(level, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)

Definition at line 51 of file ULogger.h.

◆ ULOGGER_WARN

#define ULOGGER_WARN (   ...)    ULOGGER_LOG(ULogger::kWarning, __VA_ARGS__)

Definition at line 55 of file ULogger.h.

◆ UWARN

#define UWARN (   ...)    ULOGGER_WARN(__VA_ARGS__)

Print a warning level message in the logger. Format is the same as a printf:

UWARN("This is a warning message with the number %d", 42);
UINFO
#define UINFO(...)
UFATAL
#define UFATAL(...)
UASSERT
#define UASSERT(condition)
UWARN
#define UWARN(...)
UDEBUG
#define UDEBUG(...)
UERROR
#define UERROR(...)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:25