74#define U_LOG_RAW(...) \
76 u_log(__FILE__, __LINE__, __func__, U_LOGGING_RAW, __VA_ARGS__); \
91#define U_LOG(level, ...) \
93 u_log(__FILE__, __LINE__, __func__, level, __VA_ARGS__); \
105#define U_LOG_IFL(level, cond_level, ...) \
107 if (cond_level <= level) { \
108 u_log(__FILE__, __LINE__, __func__, level, __VA_ARGS__); \
122#define U_LOG_XDEV(level, xdev, ...) \
124 u_log_xdev(__FILE__, __LINE__, __func__, level, xdev, __VA_ARGS__); \
136#define U_LOG_XDEV_IFL(level, cond_level, xdev, ...) \
138 if (cond_level <= level) { \
139 u_log_xdev(__FILE__, __LINE__, __func__, level, xdev, __VA_ARGS__); \
154#define U_LOG_IFL_HEX(level, cond_level, data, data_size) \
156 if (cond_level <= level) { \
157 u_log_hex(__FILE__, __LINE__, __func__, level, data, data_size); \
172#define U_LOG_XDEV_IFL_HEX(level, cond_level, xdev, data, data_size) \
174 if (cond_level <= level) { \
175 u_log_xdev_hex(__FILE__, __LINE__, __func__, level, xdev, data, data_size); \
200 XRT_PRINTF_FORMAT(5, 6);
221 ...) XRT_PRINTF_FORMAT(6, 7);
241 const
size_t data_size);
263 const
size_t data_size);
292#define U_LOG_T(...) U_LOG_IFL_T(u_log_get_global_level(), __VA_ARGS__)
295#define U_LOG_D(...) U_LOG_IFL_D(u_log_get_global_level(), __VA_ARGS__)
298#define U_LOG_I(...) U_LOG_IFL_I(u_log_get_global_level(), __VA_ARGS__)
301#define U_LOG_W(...) U_LOG_IFL_W(u_log_get_global_level(), __VA_ARGS__)
304#define U_LOG_E(...) U_LOG_IFL_E(u_log_get_global_level(), __VA_ARGS__)
323#define U_LOG_IFL_T(cond_level, ...) U_LOG_IFL(U_LOGGING_TRACE, cond_level, __VA_ARGS__)
325#define U_LOG_IFL_D(cond_level, ...) U_LOG_IFL(U_LOGGING_DEBUG, cond_level, __VA_ARGS__)
327#define U_LOG_IFL_I(cond_level, ...) U_LOG_IFL(U_LOGGING_INFO, cond_level, __VA_ARGS__)
329#define U_LOG_IFL_W(cond_level, ...) U_LOG_IFL(U_LOGGING_WARN, cond_level, __VA_ARGS__)
331#define U_LOG_IFL_E(cond_level, ...) U_LOG_IFL(U_LOGGING_ERROR, cond_level, __VA_ARGS__)
334#define U_LOG_IFL_T_HEX(cond_level, data, data_size) U_LOG_IFL_HEX(U_LOGGING_TRACE, cond_level, data, data_size)
336#define U_LOG_IFL_D_HEX(cond_level, data, data_size) U_LOG_IFL_HEX(U_LOGGING_DEBUG, cond_level, data, data_size)
357#define U_LOG_XDEV_IFL_T(xdev, cond_level, ...) U_LOG_XDEV_IFL(U_LOGGING_TRACE, cond_level, xdev, __VA_ARGS__)
359#define U_LOG_XDEV_IFL_D(xdev, cond_level, ...) U_LOG_XDEV_IFL(U_LOGGING_DEBUG, cond_level, xdev, __VA_ARGS__)
361#define U_LOG_XDEV_IFL_I(xdev, cond_level, ...) U_LOG_XDEV_IFL(U_LOGGING_INFO, cond_level, xdev, __VA_ARGS__)
363#define U_LOG_XDEV_IFL_W(xdev, cond_level, ...) U_LOG_XDEV_IFL(U_LOGGING_WARN, cond_level, xdev, __VA_ARGS__)
365#define U_LOG_XDEV_IFL_E(xdev, cond_level, ...) U_LOG_XDEV_IFL(U_LOGGING_ERROR, cond_level, xdev, __VA_ARGS__)
368#define U_LOG_XDEV_IFL_T_HEX(xdev, cond_level, data, data_size) \
369 U_LOG_XDEV_IFL_HEX(U_LOGGING_TRACE, cond_level, xdev, data, data_size)
371#define U_LOG_XDEV_IFL_D_HEX(xdev, cond_level, data, data_size) \
372 U_LOG_XDEV_IFL_HEX(U_LOGGING_DEBUG, cond_level, xdev, data, data_size)
386#define U_LOG_XDEV_UNSUPPORTED_INPUT(xdev, cond_level, name) \
388 struct u_pp_sink_stack_only sink; \
389 u_pp_delegate_t dg = u_pp_sink_stack_only_init(&sink); \
390 u_pp_xrt_input_name(dg, name); \
391 U_LOG_XDEV_IFL_E(xdev, cond_level, "Unsupported input: %s", sink.buffer); \
409#define U_LOG_XDEV_T(xdev, ...) U_LOG_XDEV(U_LOGGING_TRACE, xdev, __VA_ARGS__)
411#define U_LOG_XDEV_D(xdev, ...) U_LOG_XDEV(U_LOGGING_DEBUG, xdev, __VA_ARGS__)
413#define U_LOG_XDEV_I(xdev, ...) U_LOG_XDEV(U_LOGGING_INFO, xdev, __VA_ARGS__)
415#define U_LOG_XDEV_W(xdev, ...) U_LOG_XDEV(U_LOGGING_WARN, xdev, __VA_ARGS__)
417#define U_LOG_XDEV_E(xdev, ...) U_LOG_XDEV(U_LOGGING_ERROR, xdev, __VA_ARGS__)
u_logging_level
Logging level enum.
Definition: u_logging.h:43
void u_log(const char *file, int line, const char *func, enum u_logging_level level, const char *format,...) XRT_PRINTF_FORMAT(5
Main non-device-related log implementation function: do not call directly, use a macro that wraps it.
enum u_logging_level u_log_get_global_level(void)
Returns the global logging level, subsystems own logging level take precedence.
Definition: u_logging.c:68
void(* u_log_sink_func_t)(const char *file, int line, const char *func, enum u_logging_level level, const char *format, va_list args, void *data)
Function typedef for setting the logging sink.
Definition: u_logging.h:63
void void void u_log_hex(const char *file, int line, const char *func, enum u_logging_level level, const uint8_t *data, const size_t data_size)
Log implementation for dumping memory buffers as hex: do not call directly, use a macro that wraps it...
Definition: u_logging.c:141
void void u_log_xdev(const char *file, int line, const char *func, enum u_logging_level level, struct xrt_device *xdev, const char *format,...) XRT_PRINTF_FORMAT(6
Main device-related log implementation function: do not call directly, use a macro that wraps it.
void u_log_set_sink(u_log_sink_func_t func, void *data)
Sets the logging sink, log is still passed on to the platform defined output as well as the sink.
Definition: u_logging.c:85
void u_log_xdev_hex(const char *file, int line, const char *func, enum u_logging_level level, struct xrt_device *xdev, const uint8_t *data, const size_t data_size)
Device-related log implementation for dumping memory buffers as hex: do not call directly,...
Definition: u_logging.c:169
@ U_LOGGING_WARN
Warning messages: indicating a potential problem.
Definition: u_logging.h:47
@ U_LOGGING_DEBUG
Debug messages, verbose.
Definition: u_logging.h:45
@ U_LOGGING_TRACE
Trace messages, highly verbose.
Definition: u_logging.h:44
@ U_LOGGING_RAW
Special level for raw printing, prints a new-line.
Definition: u_logging.h:49
@ U_LOGGING_ERROR
Error messages: indicating a problem.
Definition: u_logging.h:48
@ U_LOGGING_INFO
Info messages: not very verbose, not indicating a problem.
Definition: u_logging.h:46
A single HMD or input device.
Definition: xrt_device.h:241
Pretty printing various Monado things.
Header holding common defines.