XRPrimer (C++ API)  0.6.0
logging.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define xr_log_emergency(...)   log_message(XR_LOG_EMERG, __VA_ARGS__)
 
#define xr_log_alert(...)   log_message(XR_LOG_ALERT, __VA_ARGS__)
 
#define xr_log_critical(...)   log_message(XR_LOG_CRIT, __VA_ARGS__)
 
#define xr_log_error(...)   log_message(XR_LOG_ERR, __VA_ARGS__)
 
#define xr_log_warning(...)   log_message(XR_LOG_WARNING, __VA_ARGS__)
 
#define xr_log_notice(...)   log_message(XR_LOG_NOTICE, __VA_ARGS__)
 
#define xr_log_info(...)   log_message(XR_LOG_INFO, __VA_ARGS__)
 
#define xr_log_debug(...)   log_message(XR_LOG_DEBUG, __VA_ARGS__)
 
#define xr_runtime_assert(condition, message)
 

Enumerations

enum  XRLogLevel {
  XR_LOG_DEBUG = -1, XR_LOG_INFO = 0, XR_LOG_NOTICE = 1, XR_LOG_WARNING = 2,
  XR_LOG_ERR = 3, XR_LOG_CRIT = 4, XR_LOG_ALERT = 5, XR_LOG_EMERG = 6
}
 

Functions

void log_message (XRLogLevel level, const char *format,...)
 Log message. More...
 

Macro Definition Documentation

◆ xr_log_alert

#define xr_log_alert (   ...)    log_message(XR_LOG_ALERT, __VA_ARGS__)

◆ xr_log_critical

#define xr_log_critical (   ...)    log_message(XR_LOG_CRIT, __VA_ARGS__)

◆ xr_log_debug

#define xr_log_debug (   ...)    log_message(XR_LOG_DEBUG, __VA_ARGS__)

◆ xr_log_emergency

#define xr_log_emergency (   ...)    log_message(XR_LOG_EMERG, __VA_ARGS__)

◆ xr_log_error

#define xr_log_error (   ...)    log_message(XR_LOG_ERR, __VA_ARGS__)

◆ xr_log_info

#define xr_log_info (   ...)    log_message(XR_LOG_INFO, __VA_ARGS__)

◆ xr_log_notice

#define xr_log_notice (   ...)    log_message(XR_LOG_NOTICE, __VA_ARGS__)

◆ xr_log_warning

#define xr_log_warning (   ...)    log_message(XR_LOG_WARNING, __VA_ARGS__)

◆ xr_runtime_assert

#define xr_runtime_assert (   condition,
  message 
)
Value:
do { \
if (!(condition)) { \
log_error("Assertion failed at " __FILE__ \
":%d : %s\nWhen testing condition:\n %s", \
__LINE__, message, #condition); \
abort(); \
} \
} while (0)

Enumeration Type Documentation

◆ XRLogLevel

enum XRLogLevel
Enumerator
XR_LOG_DEBUG 

debug message

XR_LOG_INFO 

informational message

XR_LOG_NOTICE 

normal, but significant, condition

XR_LOG_WARNING 

warning conditions

XR_LOG_ERR 

error conditions

XR_LOG_CRIT 

critical conditions

XR_LOG_ALERT 

action must be taken immediately

XR_LOG_EMERG 

system is unusable

Function Documentation

◆ log_message()

void log_message ( XRLogLevel  level,
const char *  format,
  ... 
)

Log message.

Parameters
levelMessage level defined in XRLogLevel
formatPointer to a string which consists of characters along with optional format specifiers starting with %