The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

xrt: Tidy s/ll/log_level/g

Also make sure all variable logging uses the right type for logging variables.

authored by

Jakob Bornecrantz and committed by
Ryan Pavlik
3f98ea55 431857dd

+413 -409
+7 -7
src/xrt/auxiliary/tracking/t_imu_fusion.hpp
··· 27 27 28 28 DEBUG_GET_ONCE_LOG_OPTION(simple_imu_log, "SIMPLE_IMU_LOG", U_LOGGING_WARN) 29 29 30 - #define SIMPLE_IMU_TRACE(...) U_LOG_IFL_T(ll, __VA_ARGS__) 31 - #define SIMPLE_IMU_DEBUG(...) U_LOG_IFL_D(ll, __VA_ARGS__) 32 - #define SIMPLE_IMU_INFO(...) U_LOG_IFL_I(ll, __VA_ARGS__) 33 - #define SIMPLE_IMU_WARN(...) U_LOG_IFL_W(ll, __VA_ARGS__) 34 - #define SIMPLE_IMU_ERROR(...) U_LOG_IFL_E(ll, __VA_ARGS__) 30 + #define SIMPLE_IMU_TRACE(...) U_LOG_IFL_T(log_level, __VA_ARGS__) 31 + #define SIMPLE_IMU_DEBUG(...) U_LOG_IFL_D(log_level, __VA_ARGS__) 32 + #define SIMPLE_IMU_INFO(...) U_LOG_IFL_I(log_level, __VA_ARGS__) 33 + #define SIMPLE_IMU_WARN(...) U_LOG_IFL_W(log_level, __VA_ARGS__) 34 + #define SIMPLE_IMU_ERROR(...) U_LOG_IFL_E(log_level, __VA_ARGS__) 35 35 36 36 namespace xrt::auxiliary::tracking { 37 37 ··· 47 47 * accelerometer should affect the orientation each second. 48 48 */ 49 49 explicit SimpleIMUFusion(double gravity_rate = 0.9) 50 - : gravity_scale_(gravity_rate), ll(debug_get_log_option_simple_imu_log()) 50 + : gravity_scale_(gravity_rate), log_level(debug_get_log_option_simple_imu_log()) 51 51 { 52 52 SIMPLE_IMU_DEBUG("Creating instance"); 53 53 } ··· 202 202 uint64_t last_gyro_timestamp_{0}; 203 203 double gyro_min_squared_length_{1.e-8}; 204 204 bool started_{false}; 205 - enum u_logging_level ll; 205 + enum u_logging_level log_level; 206 206 }; 207 207 208 208 inline Eigen::Quaterniond
+8 -8
src/xrt/auxiliary/tracking/t_tracker_psvr.cpp
··· 40 40 41 41 DEBUG_GET_ONCE_LOG_OPTION(psvr_log, "PSVR_TRACKING_LOG", U_LOGGING_WARN) 42 42 43 - #define PSVR_TRACE(...) U_LOG_IFL_T(t.ll, __VA_ARGS__) 44 - #define PSVR_DEBUG(...) U_LOG_IFL_D(t.ll, __VA_ARGS__) 45 - #define PSVR_INFO(...) U_LOG_IFL_I(t.ll, __VA_ARGS__) 46 - #define PSVR_WARN(...) U_LOG_IFL_W(t.ll, __VA_ARGS__) 47 - #define PSVR_ERROR(...) U_LOG_IFL_E(t.ll, __VA_ARGS__) 43 + #define PSVR_TRACE(...) U_LOG_IFL_T(t.log_level, __VA_ARGS__) 44 + #define PSVR_DEBUG(...) U_LOG_IFL_D(t.log_level, __VA_ARGS__) 45 + #define PSVR_INFO(...) U_LOG_IFL_I(t.log_level, __VA_ARGS__) 46 + #define PSVR_WARN(...) U_LOG_IFL_W(t.log_level, __VA_ARGS__) 47 + #define PSVR_ERROR(...) U_LOG_IFL_E(t.log_level, __VA_ARGS__) 48 48 49 49 50 50 /*! ··· 220 220 struct xrt_frame_node node = {}; 221 221 222 222 //! Logging stuff. 223 - enum u_logging_level ll; 223 + enum u_logging_level log_level; 224 224 225 225 //! Frame waiting to be processed. 226 226 struct xrt_frame *frame; ··· 2045 2045 struct xrt_frame_sink **out_sink) 2046 2046 { 2047 2047 auto &t = *(new TrackerPSVR()); 2048 - t.ll = debug_get_log_option_psvr_log(); 2048 + t.log_level = debug_get_log_option_psvr_log(); 2049 2049 2050 2050 PSVR_INFO("%s", __func__); 2051 2051 int ret; ··· 2135 2135 2136 2136 // Everything is safe, now setup the variable tracking. 2137 2137 u_var_add_root(&t, "PSVR Tracker", true); 2138 - u_var_add_log_level(&t, &t.ll, "Log level"); 2138 + u_var_add_log_level(&t, &t.log_level, "Log level"); 2139 2139 u_var_add_sink_debug(&t, &t.debug.usd, "Debug"); 2140 2140 2141 2141 *out_sink = &t.sink;
+12 -11
src/xrt/auxiliary/tracking/t_tracker_slam.cpp
··· 18 18 #include <opencv2/core/mat.hpp> 19 19 #include <opencv2/core/version.hpp> 20 20 21 - #define SLAM_TRACE(...) U_LOG_IFL_T(t.ll, __VA_ARGS__) 22 - #define SLAM_DEBUG(...) U_LOG_IFL_D(t.ll, __VA_ARGS__) 23 - #define SLAM_INFO(...) U_LOG_IFL_I(t.ll, __VA_ARGS__) 24 - #define SLAM_WARN(...) U_LOG_IFL_W(t.ll, __VA_ARGS__) 25 - #define SLAM_ERROR(...) U_LOG_IFL_E(t.ll, __VA_ARGS__) 21 + #define SLAM_TRACE(...) U_LOG_IFL_T(t.log_level, __VA_ARGS__) 22 + #define SLAM_DEBUG(...) U_LOG_IFL_D(t.log_level, __VA_ARGS__) 23 + #define SLAM_INFO(...) U_LOG_IFL_I(t.log_level, __VA_ARGS__) 24 + #define SLAM_WARN(...) U_LOG_IFL_W(t.log_level, __VA_ARGS__) 25 + #define SLAM_ERROR(...) U_LOG_IFL_E(t.log_level, __VA_ARGS__) 26 26 #define SLAM_ASSERT(predicate, ...) \ 27 27 do { \ 28 28 bool p = predicate; \ ··· 168 168 struct xrt_frame_sink right_sink = {}; //!< Sends right camera frames to the SLAM system 169 169 struct xrt_imu_sink imu_sink = {}; //!< Sends imu samples to the SLAM system 170 170 171 - enum u_logging_level ll; //!< Logging level for the SLAM tracker, set by SLAM_LOG var 172 - struct os_thread_helper oth; //!< Thread where the external SLAM system runs 173 - MatFrame *cv_wrapper; //!< Wraps a xrt_frame in a cv::Mat to send to the SLAM system 171 + enum u_logging_level log_level; //!< Logging level for the SLAM tracker, set by SLAM_LOG var 172 + struct os_thread_helper oth; //!< Thread where the external SLAM system runs 173 + MatFrame *cv_wrapper; //!< Wraps a xrt_frame in a cv::Mat to send to the SLAM system 174 174 175 175 // Used for checking that the timestamps come in order 176 176 mutable timepoint_ns last_imu_ts = INT64_MIN; ··· 306 306 extern "C" int 307 307 t_slam_create(struct xrt_frame_context *xfctx, struct xrt_tracked_slam **out_xts, struct xrt_slam_sinks **out_sink) 308 308 { 309 - enum u_logging_level ll = debug_get_log_option_slam_log(); 309 + enum u_logging_level log_level = debug_get_log_option_slam_log(); 310 310 const char *config_file = debug_get_option_slam_config(); 311 311 if (!config_file) { 312 - U_LOG_IFL_W(ll, "SLAM tracker requires a config file set with the SLAM_CONFIG environment variable"); 312 + U_LOG_IFL_W(log_level, 313 + "SLAM tracker requires a config file set with the SLAM_CONFIG environment variable"); 313 314 return -1; 314 315 } 315 316 316 317 auto &t = *(new TrackerSlam{}); 317 - t.ll = ll; 318 + t.log_level = log_level; 318 319 t.cv_wrapper = new MatFrame(); 319 320 320 321 t.base.get_tracked_pose = t_slam_get_tracked_pose;
+6 -6
src/xrt/auxiliary/util/u_timing_frame.c
··· 20 20 #include <assert.h> 21 21 #include <inttypes.h> 22 22 23 - DEBUG_GET_ONCE_LOG_OPTION(ll, "U_TIMING_FRAME_LOG", U_LOGGING_WARN) 23 + DEBUG_GET_ONCE_LOG_OPTION(log_level, "U_TIMING_FRAME_LOG", U_LOGGING_WARN) 24 24 25 - #define FT_LOG_T(...) U_LOG_IFL_T(debug_get_log_option_ll(), __VA_ARGS__) 26 - #define FT_LOG_D(...) U_LOG_IFL_D(debug_get_log_option_ll(), __VA_ARGS__) 27 - #define FT_LOG_I(...) U_LOG_IFL_I(debug_get_log_option_ll(), __VA_ARGS__) 28 - #define FT_LOG_W(...) U_LOG_IFL_W(debug_get_log_option_ll(), __VA_ARGS__) 29 - #define FT_LOG_E(...) U_LOG_IFL_E(debug_get_log_option_ll(), __VA_ARGS__) 25 + #define FT_LOG_T(...) U_LOG_IFL_T(debug_get_log_option_log_level(), __VA_ARGS__) 26 + #define FT_LOG_D(...) U_LOG_IFL_D(debug_get_log_option_log_level(), __VA_ARGS__) 27 + #define FT_LOG_I(...) U_LOG_IFL_I(debug_get_log_option_log_level(), __VA_ARGS__) 28 + #define FT_LOG_W(...) U_LOG_IFL_W(debug_get_log_option_log_level(), __VA_ARGS__) 29 + #define FT_LOG_E(...) U_LOG_IFL_E(debug_get_log_option_log_level(), __VA_ARGS__) 30 30 31 31 #define NUM_FRAMES 16 32 32
+6 -6
src/xrt/auxiliary/util/u_timing_render.c
··· 104 104 return (struct render_timing *)urt; 105 105 } 106 106 107 - DEBUG_GET_ONCE_LOG_OPTION(ll, "U_TIMING_RENDER_LOG", U_LOGGING_WARN) 107 + DEBUG_GET_ONCE_LOG_OPTION(log_level, "U_TIMING_RENDER_LOG", U_LOGGING_WARN) 108 108 109 - #define RT_LOG_T(...) U_LOG_IFL_T(debug_get_log_option_ll(), __VA_ARGS__) 110 - #define RT_LOG_D(...) U_LOG_IFL_D(debug_get_log_option_ll(), __VA_ARGS__) 111 - #define RT_LOG_I(...) U_LOG_IFL_I(debug_get_log_option_ll(), __VA_ARGS__) 112 - #define RT_LOG_W(...) U_LOG_IFL_W(debug_get_log_option_ll(), __VA_ARGS__) 113 - #define RT_LOG_E(...) U_LOG_IFL_E(debug_get_log_option_ll(), __VA_ARGS__) 109 + #define RT_LOG_T(...) U_LOG_IFL_T(debug_get_log_option_log_level(), __VA_ARGS__) 110 + #define RT_LOG_D(...) U_LOG_IFL_D(debug_get_log_option_log_level(), __VA_ARGS__) 111 + #define RT_LOG_I(...) U_LOG_IFL_I(debug_get_log_option_log_level(), __VA_ARGS__) 112 + #define RT_LOG_W(...) U_LOG_IFL_W(debug_get_log_option_log_level(), __VA_ARGS__) 113 + #define RT_LOG_E(...) U_LOG_IFL_E(debug_get_log_option_log_level(), __VA_ARGS__) 114 114 115 115 #define DEBUG_PRINT_FRAME_ID() RT_LOG_T("%" PRIi64, frame_id) 116 116 #define GET_INDEX_FROM_ID(RT, ID) ((uint64_t)(ID) % ARRAY_SIZE((RT)->frames))
+11 -11
src/xrt/auxiliary/vive/vive_config.c
··· 23 23 #include "math/m_space.h" 24 24 25 25 26 - #define VIVE_TRACE(d, ...) U_LOG_IFL_T(d->ll, __VA_ARGS__) 27 - #define VIVE_DEBUG(d, ...) U_LOG_IFL_D(d->ll, __VA_ARGS__) 28 - #define VIVE_INFO(d, ...) U_LOG_IFL_I(d->ll, __VA_ARGS__) 29 - #define VIVE_WARN(d, ...) U_LOG_IFL_W(d->ll, __VA_ARGS__) 30 - #define VIVE_ERROR(d, ...) U_LOG_IFL_E(d->ll, __VA_ARGS__) 26 + #define VIVE_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__) 27 + #define VIVE_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__) 28 + #define VIVE_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__) 29 + #define VIVE_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__) 30 + #define VIVE_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__) 31 31 32 32 #define JSON_INT(a, b, c) u_json_get_int(u_json_get(a, b), c) 33 33 #define JSON_FLOAT(a, b, c) u_json_get_float(u_json_get(a, b), c) ··· 381 381 } 382 382 383 383 bool 384 - vive_config_parse(struct vive_config *d, char *json_string, enum u_logging_level ll) 384 + vive_config_parse(struct vive_config *d, char *json_string, enum u_logging_level log_level) 385 385 { 386 - d->ll = ll; 386 + d->log_level = log_level; 387 387 vive_init_defaults(d); 388 388 389 389 VIVE_DEBUG(d, "JSON config:\n%s", json_string); ··· 505 505 VIVE_DEBUG(d, "eye_target_height_in_pixels: %d", d->display.eye_target_height_in_pixels); 506 506 VIVE_DEBUG(d, "eye_target_width_in_pixels: %d", d->display.eye_target_width_in_pixels); 507 507 508 - if (d->ll <= U_LOGGING_DEBUG) { 508 + if (d->log_level <= U_LOGGING_DEBUG) { 509 509 _print_vec3("acc_bias", &d->imu.acc_bias); 510 510 _print_vec3("acc_scale", &d->imu.acc_scale); 511 511 _print_vec3("gyro_bias", &d->imu.gyro_bias); ··· 532 532 } 533 533 534 534 bool 535 - vive_config_parse_controller(struct vive_controller_config *d, char *json_string, enum u_logging_level ll) 535 + vive_config_parse_controller(struct vive_controller_config *d, char *json_string, enum u_logging_level log_level) 536 536 { 537 - d->ll = ll; 537 + d->log_level = log_level; 538 538 VIVE_DEBUG(d, "JSON config:\n%s", json_string); 539 539 540 540 cJSON *json = cJSON_Parse(json_string); ··· 612 612 VIVE_DEBUG(d, "mb_serial_number: %s", d->firmware.mb_serial_number); 613 613 VIVE_DEBUG(d, "device_serial_number: %s", d->firmware.device_serial_number); 614 614 615 - if (d->ll <= U_LOGGING_DEBUG) { 615 + if (d->log_level <= U_LOGGING_DEBUG) { 616 616 _print_vec3("acc_bias", &d->imu.acc_bias); 617 617 _print_vec3("acc_scale", &d->imu.acc_scale); 618 618 _print_vec3("gyro_bias", &d->imu.gyro_bias);
+4 -4
src/xrt/auxiliary/vive/vive_config.h
··· 105 105 struct vive_config 106 106 { 107 107 //! log level accessed by the config parser 108 - enum u_logging_level ll; 108 + enum u_logging_level log_level; 109 109 110 110 enum VIVE_VARIANT variant; 111 111 ··· 172 172 173 173 struct vive_controller_config 174 174 { 175 - enum u_logging_level ll; 175 + enum u_logging_level log_level; 176 176 177 177 enum VIVE_CONTROLLER_VARIANT variant; 178 178 ··· 203 203 }; 204 204 205 205 bool 206 - vive_config_parse(struct vive_config *d, char *json_string, enum u_logging_level ll); 206 + vive_config_parse(struct vive_config *d, char *json_string, enum u_logging_level log_level); 207 207 208 208 /*! 209 209 * Free any allocated resources on this config. ··· 214 214 struct vive_controller_device; 215 215 216 216 bool 217 - vive_config_parse_controller(struct vive_controller_config *d, char *json_string, enum u_logging_level ll); 217 + vive_config_parse_controller(struct vive_controller_config *d, char *json_string, enum u_logging_level log_level); 218 218 219 219 bool 220 220 vive_get_stereo_camera_calibration(struct vive_config *d,
+6 -6
src/xrt/auxiliary/vk/vk_helpers.h
··· 44 44 */ 45 45 struct vk_bundle 46 46 { 47 - enum u_logging_level ll; 47 + enum u_logging_level log_level; 48 48 49 49 VkInstance instance; 50 50 VkPhysicalDevice physical_device; ··· 311 311 * 312 312 */ 313 313 314 - #define VK_TRACE(d, ...) U_LOG_IFL_T(d->ll, __VA_ARGS__) 315 - #define VK_DEBUG(d, ...) U_LOG_IFL_D(d->ll, __VA_ARGS__) 316 - #define VK_INFO(d, ...) U_LOG_IFL_I(d->ll, __VA_ARGS__) 317 - #define VK_WARN(d, ...) U_LOG_IFL_W(d->ll, __VA_ARGS__) 318 - #define VK_ERROR(d, ...) U_LOG_IFL_E(d->ll, __VA_ARGS__) 314 + #define VK_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__) 315 + #define VK_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__) 316 + #define VK_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__) 317 + #define VK_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__) 318 + #define VK_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__) 319 319 320 320 /*! 321 321 * @brief Check a Vulkan VkResult, writing an error to the log and returning true if not VK_SUCCESS
+7 -7
src/xrt/compositor/client/comp_egl_client.c
··· 40 40 * 41 41 */ 42 42 43 - static enum u_logging_level ll; 43 + static enum u_logging_level log_level; 44 44 45 - #define EGL_TRACE(...) U_LOG_IFL_T(ll, __VA_ARGS__) 46 - #define EGL_DEBUG(...) U_LOG_IFL_D(ll, __VA_ARGS__) 47 - #define EGL_INFO(...) U_LOG_IFL_I(ll, __VA_ARGS__) 48 - #define EGL_WARN(...) U_LOG_IFL_W(ll, __VA_ARGS__) 49 - #define EGL_ERROR(...) U_LOG_IFL_E(ll, __VA_ARGS__) 45 + #define EGL_TRACE(...) U_LOG_IFL_T(log_level, __VA_ARGS__) 46 + #define EGL_DEBUG(...) U_LOG_IFL_D(log_level, __VA_ARGS__) 47 + #define EGL_INFO(...) U_LOG_IFL_I(log_level, __VA_ARGS__) 48 + #define EGL_WARN(...) U_LOG_IFL_W(log_level, __VA_ARGS__) 49 + #define EGL_ERROR(...) U_LOG_IFL_E(log_level, __VA_ARGS__) 50 50 51 51 DEBUG_GET_ONCE_LOG_OPTION(egl_log, "EGL_LOG", U_LOGGING_INFO) 52 52 ··· 233 233 PFNEGLGETPROCADDRESSPROC get_gl_procaddr, 234 234 struct xrt_compositor_gl **out_xcgl) 235 235 { 236 - ll = debug_get_log_option_egl_log(); 236 + log_level = debug_get_log_option_egl_log(); 237 237 238 238 gladLoadEGL(display, get_gl_procaddr); 239 239
+7 -7
src/xrt/compositor/client/comp_gl_eglimage_swapchain.c
··· 33 33 #include <inttypes.h> 34 34 35 35 36 - static enum u_logging_level ll; 36 + static enum u_logging_level log_level; 37 37 38 - #define EGL_SC_TRACE(...) U_LOG_IFL_T(ll, __VA_ARGS__) 39 - #define EGL_SC_DEBUG(...) U_LOG_IFL_D(ll, __VA_ARGS__) 40 - #define EGL_SC_INFO(...) U_LOG_IFL_I(ll, __VA_ARGS__) 41 - #define EGL_SC_WARN(...) U_LOG_IFL_W(ll, __VA_ARGS__) 42 - #define EGL_SC_ERROR(...) U_LOG_IFL_E(ll, __VA_ARGS__) 38 + #define EGL_SC_TRACE(...) U_LOG_IFL_T(log_level, __VA_ARGS__) 39 + #define EGL_SC_DEBUG(...) U_LOG_IFL_D(log_level, __VA_ARGS__) 40 + #define EGL_SC_INFO(...) U_LOG_IFL_I(log_level, __VA_ARGS__) 41 + #define EGL_SC_WARN(...) U_LOG_IFL_W(log_level, __VA_ARGS__) 42 + #define EGL_SC_ERROR(...) U_LOG_IFL_E(log_level, __VA_ARGS__) 43 43 44 44 DEBUG_GET_ONCE_LOG_OPTION(egl_swapchain_log, "EGL_SWAPCHAIN_LOG", U_LOGGING_WARN) 45 45 ··· 166 166 struct client_gl_swapchain **out_sc) 167 167 { 168 168 struct client_egl_compositor *ceglc = client_egl_compositor(xc); 169 - ll = debug_get_log_option_egl_swapchain_log(); 169 + log_level = debug_get_log_option_egl_swapchain_log(); 170 170 171 171 if (xscn == NULL) { 172 172 EGL_SC_ERROR("Native compositor is null");
+1 -1
src/xrt/compositor/util/comp_vulkan.c
··· 222 222 { 223 223 VkResult ret; 224 224 225 - vk->ll = vk_args->log_level; 225 + vk->log_level = vk_args->log_level; 226 226 227 227 ret = vk_get_loader_functions(vk, vk_args->get_instance_proc_address); 228 228 if (ret != VK_SUCCESS) {
+1 -1
src/xrt/drivers/android/android_sensors.c
··· 210 210 snprintf(d->base.str, XRT_DEVICE_NAME_LEN, "Android Sensors"); 211 211 snprintf(d->base.serial, XRT_DEVICE_NAME_LEN, "Android Sensors"); 212 212 213 - d->ll = debug_get_log_option_android_log(); 213 + d->log_level = debug_get_log_option_android_log(); 214 214 215 215 m_imu_3dof_init(&d->fusion, M_IMU_3DOF_USE_GRAVITY_DUR_20MS); 216 216
+6 -6
src/xrt/drivers/android/android_sensors.h
··· 48 48 struct m_imu_3dof fusion; 49 49 }; 50 50 51 - enum u_logging_level ll; 51 + enum u_logging_level log_level; 52 52 }; 53 53 54 54 ··· 62 62 * 63 63 */ 64 64 65 - #define ANDROID_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->ll, __VA_ARGS__) 66 - #define ANDROID_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->ll, __VA_ARGS__) 67 - #define ANDROID_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->ll, __VA_ARGS__) 68 - #define ANDROID_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->ll, __VA_ARGS__) 69 - #define ANDROID_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->ll, __VA_ARGS__) 65 + #define ANDROID_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->log_level, __VA_ARGS__) 66 + #define ANDROID_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->log_level, __VA_ARGS__) 67 + #define ANDROID_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->log_level, __VA_ARGS__) 68 + #define ANDROID_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->log_level, __VA_ARGS__) 69 + #define ANDROID_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->log_level, __VA_ARGS__) 70 70 71 71 #ifdef __cplusplus 72 72 }
+7 -7
src/xrt/drivers/arduino/arduino_device.c
··· 94 94 bool last; 95 95 } gui; 96 96 97 - enum u_logging_level ll; 97 + enum u_logging_level log_level; 98 98 }; 99 99 100 100 ··· 104 104 * 105 105 */ 106 106 107 - #define ARDUINO_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->ll, __VA_ARGS__) 108 - #define ARDUINO_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->ll, __VA_ARGS__) 109 - #define ARDUINO_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->ll, __VA_ARGS__) 110 - #define ARDUINO_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->ll, __VA_ARGS__) 111 - #define ARDUINO_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->ll, __VA_ARGS__) 107 + #define ARDUINO_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->log_level, __VA_ARGS__) 108 + #define ARDUINO_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->log_level, __VA_ARGS__) 109 + #define ARDUINO_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->log_level, __VA_ARGS__) 110 + #define ARDUINO_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->log_level, __VA_ARGS__) 111 + #define ARDUINO_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->log_level, __VA_ARGS__) 112 112 113 113 static inline struct arduino_device * 114 114 arduino_device(struct xrt_device *xdev) ··· 395 395 snprintf(ad->base.serial, XRT_DEVICE_NAME_LEN, "Arduino %d", controller_num++); 396 396 397 397 ad->ble = ble; 398 - ad->ll = debug_get_log_option_arduino_log(); 398 + ad->log_level = debug_get_log_option_arduino_log(); 399 399 400 400 m_imu_3dof_init(&ad->fusion, M_IMU_3DOF_USE_GRAVITY_DUR_300MS); 401 401
+1 -1
src/xrt/drivers/daydream/daydream_device.c
··· 375 375 snprintf(dd->base.serial, XRT_DEVICE_NAME_LEN, "Daydream %d", controller_num++); 376 376 377 377 dd->ble = ble; 378 - dd->ll = debug_get_log_option_daydream_log(); 378 + dd->log_level = debug_get_log_option_daydream_log(); 379 379 380 380 float accel_ticks_to_float = MATH_GRAVITY_M_S2 / 520.0; 381 381 float gyro_ticks_to_float = 1.0 / 120.0;
+6 -6
src/xrt/drivers/daydream/daydream_device.h
··· 86 86 struct m_imu_3dof fusion; 87 87 }; 88 88 89 - enum u_logging_level ll; 89 + enum u_logging_level log_level; 90 90 91 91 struct 92 92 { ··· 99 99 daydream_device_create(struct os_ble_device *ble); 100 100 101 101 102 - #define DAYDREAM_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->ll, __VA_ARGS__) 103 - #define DAYDREAM_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->ll, __VA_ARGS__) 104 - #define DAYDREAM_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->ll, __VA_ARGS__) 105 - #define DAYDREAM_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->ll, __VA_ARGS__) 106 - #define DAYDREAM_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->ll, __VA_ARGS__) 102 + #define DAYDREAM_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->log_level, __VA_ARGS__) 103 + #define DAYDREAM_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->log_level, __VA_ARGS__) 104 + #define DAYDREAM_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->log_level, __VA_ARGS__) 105 + #define DAYDREAM_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->log_level, __VA_ARGS__) 106 + #define DAYDREAM_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->log_level, __VA_ARGS__) 107 107 108 108 109 109 #ifdef __cplusplus
+8 -8
src/xrt/drivers/depthai/depthai_driver.cpp
··· 42 42 * 43 43 */ 44 44 45 - #define DEPTHAI_TRACE(d, ...) U_LOG_IFL_T(d->ll, __VA_ARGS__) 46 - #define DEPTHAI_DEBUG(d, ...) U_LOG_IFL_D(d->ll, __VA_ARGS__) 47 - #define DEPTHAI_INFO(d, ...) U_LOG_IFL_I(d->ll, __VA_ARGS__) 48 - #define DEPTHAI_WARN(d, ...) U_LOG_IFL_W(d->ll, __VA_ARGS__) 49 - #define DEPTHAI_ERROR(d, ...) U_LOG_IFL_E(d->ll, __VA_ARGS__) 45 + #define DEPTHAI_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__) 46 + #define DEPTHAI_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__) 47 + #define DEPTHAI_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__) 48 + #define DEPTHAI_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__) 49 + #define DEPTHAI_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__) 50 50 51 51 DEBUG_GET_ONCE_LOG_OPTION(depthai_log, "DEPTHAI_LOG", U_LOGGING_INFO) 52 52 ··· 113 113 struct xrt_frame_node node; 114 114 struct os_thread_helper play_thread; 115 115 116 - u_logging_level ll; 116 + u_logging_level log_level; 117 117 118 118 uint32_t width; 119 119 uint32_t height; ··· 243 243 static void 244 244 depthai_print_calib(struct depthai_fs *depthai) 245 245 { 246 - if (depthai->ll > U_LOGGING_DEBUG) { 246 + if (depthai->log_level > U_LOGGING_DEBUG) { 247 247 return; 248 248 } 249 249 ··· 637 637 depthai->base.is_running = depthai_fs_is_running; 638 638 depthai->node.break_apart = depthai_fs_node_break_apart; 639 639 depthai->node.destroy = depthai_fs_node_destroy; 640 - depthai->ll = debug_get_log_option_depthai_log(); 640 + depthai->log_level = debug_get_log_option_depthai_log(); 641 641 depthai->device = d; 642 642 643 643 // Some debug printing.
+2 -2
src/xrt/drivers/euroc/euroc_device.c
··· 90 90 struct xrt_pose offset; 91 91 struct xrt_pose pose; 92 92 struct xrt_tracking_origin tracking_origin; 93 - enum u_logging_level ll; 93 + enum u_logging_level log_level; 94 94 }; 95 95 96 96 static inline struct euroc_device * ··· 197 197 198 198 ed->pose = (struct xrt_pose){{0, 0, 0, 1}, {0, 0, 0}}; 199 199 ed->offset = (struct xrt_pose){{0, 0, 0, 1}, {0.2, 1.3, -0.5}}; 200 - ed->ll = debug_get_log_option_euroc_log(); 200 + ed->log_level = debug_get_log_option_euroc_log(); 201 201 202 202 struct xrt_device *xd = &ed->base; 203 203
+5 -5
src/xrt/drivers/euroc/euroc_driver.h
··· 17 17 * @{ 18 18 */ 19 19 20 - #define EUROC_TRACE(e, ...) U_LOG_IFL_T(e->ll, __VA_ARGS__) 21 - #define EUROC_DEBUG(e, ...) U_LOG_IFL_D(e->ll, __VA_ARGS__) 22 - #define EUROC_INFO(e, ...) U_LOG_IFL_I(e->ll, __VA_ARGS__) 23 - #define EUROC_WARN(e, ...) U_LOG_IFL_W(e->ll, __VA_ARGS__) 24 - #define EUROC_ERROR(e, ...) U_LOG_IFL_E(e->ll, __VA_ARGS__) 20 + #define EUROC_TRACE(e, ...) U_LOG_IFL_T(e->log_level, __VA_ARGS__) 21 + #define EUROC_DEBUG(e, ...) U_LOG_IFL_D(e->log_level, __VA_ARGS__) 22 + #define EUROC_INFO(e, ...) U_LOG_IFL_I(e->log_level, __VA_ARGS__) 23 + #define EUROC_WARN(e, ...) U_LOG_IFL_W(e->log_level, __VA_ARGS__) 24 + #define EUROC_ERROR(e, ...) U_LOG_IFL_E(e->log_level, __VA_ARGS__) 25 25 #define EUROC_ASSERT(predicate, ...) \ 26 26 do { \ 27 27 bool p = predicate; \
+3 -3
src/xrt/drivers/euroc/euroc_player.cpp
··· 59 59 struct xrt_slam_sinks out_sinks; //!< Pointers to downstream sinks 60 60 61 61 struct os_thread_helper play_thread; 62 - enum u_logging_level ll; 62 + enum u_logging_level log_level; 63 63 struct xrt_fs_mode mode; //!< The only fs mode the euroc dataset provides 64 64 bool is_running; //!< Set only at start and stop of frameserver stream 65 65 ··· 678 678 u_var_add_ro_text(ep, ep->progress_text, "Progress"); 679 679 u_var_add_button(ep, &ep->start_btn, "Start"); 680 680 u_var_add_button(ep, &ep->pause_btn, "Pause"); 681 - u_var_add_log_level(ep, &ep->ll, "Log Level"); 681 + u_var_add_log_level(ep, &ep->log_level, "Log level"); 682 682 683 683 u_var_add_gui_header(ep, NULL, "Playback Options"); 684 684 u_var_add_ro_text(ep, "When using a SLAM system, setting these after start is unlikely to work", "Note"); ··· 726 726 ep->playback.send_all_imus_first = false; 727 727 ep->playback.use_source_ts = false; 728 728 729 - ep->ll = debug_get_log_option_euroc_log(); 729 + ep->log_level = debug_get_log_option_euroc_log(); 730 730 euroc_player_setup_gui(ep); 731 731 732 732 ep->left_sink.push_frame = receive_left_frame;
+2 -2
src/xrt/drivers/hdk/hdk_device.cpp
··· 315 315 hd->base.inputs[0].name = XRT_INPUT_GENERIC_HEAD_POSE; 316 316 hd->base.name = XRT_DEVICE_GENERIC_HMD; 317 317 hd->dev = dev; 318 - hd->ll = debug_get_log_option_hdk_log(); 318 + hd->log_level = debug_get_log_option_hdk_log(); 319 319 320 320 snprintf(hd->base.str, XRT_DEVICE_NAME_LEN, "OSVR HDK-family Device"); 321 321 snprintf(hd->base.serial, XRT_DEVICE_NAME_LEN, "OSVR HDK-family Device"); ··· 495 495 } 496 496 } 497 497 498 - if (hd->ll <= U_LOGGING_DEBUG) { 498 + if (hd->log_level <= U_LOGGING_DEBUG) { 499 499 u_device_dump_config(&hd->base, __func__, hd->base.str); 500 500 } 501 501
+6 -6
src/xrt/drivers/hdk/hdk_device.h
··· 37 37 struct os_thread_helper imu_thread; 38 38 struct os_mutex lock; 39 39 40 - enum u_logging_level ll; 40 + enum u_logging_level log_level; 41 41 bool disconnect_notified; 42 42 43 43 struct xrt_quat quat; ··· 61 61 * 62 62 */ 63 63 64 - #define HDK_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->ll, __VA_ARGS__) 65 - #define HDK_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->ll, __VA_ARGS__) 66 - #define HDK_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->ll, __VA_ARGS__) 67 - #define HDK_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->ll, __VA_ARGS__) 68 - #define HDK_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->ll, __VA_ARGS__) 64 + #define HDK_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->log_level, __VA_ARGS__) 65 + #define HDK_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->log_level, __VA_ARGS__) 66 + #define HDK_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->log_level, __VA_ARGS__) 67 + #define HDK_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->log_level, __VA_ARGS__) 68 + #define HDK_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->log_level, __VA_ARGS__) 69 69 70 70 #ifdef __cplusplus 71 71 }
+1 -1
src/xrt/drivers/ht/ht_driver.cpp
··· 635 635 struct ht_device *htd = U_DEVICE_ALLOCATE(struct ht_device, flags, num_hands, 0); 636 636 637 637 // Setup logging first. We like logging. 638 - htd->ll = debug_get_log_option_ht_log(); 638 + htd->log_level = debug_get_log_option_ht_log(); 639 639 640 640 /* 641 641 * Get configuration
+6 -6
src/xrt/drivers/ht/ht_driver.hpp
··· 43 43 44 44 using namespace xrt::auxiliary::util; 45 45 46 - #define HT_TRACE(htd, ...) U_LOG_XDEV_IFL_T(&htd->base, htd->ll, __VA_ARGS__) 47 - #define HT_DEBUG(htd, ...) U_LOG_XDEV_IFL_D(&htd->base, htd->ll, __VA_ARGS__) 48 - #define HT_INFO(htd, ...) U_LOG_XDEV_IFL_I(&htd->base, htd->ll, __VA_ARGS__) 49 - #define HT_WARN(htd, ...) U_LOG_XDEV_IFL_W(&htd->base, htd->ll, __VA_ARGS__) 50 - #define HT_ERROR(htd, ...) U_LOG_XDEV_IFL_E(&htd->base, htd->ll, __VA_ARGS__) 46 + #define HT_TRACE(htd, ...) U_LOG_XDEV_IFL_T(&htd->base, htd->log_level, __VA_ARGS__) 47 + #define HT_DEBUG(htd, ...) U_LOG_XDEV_IFL_D(&htd->base, htd->log_level, __VA_ARGS__) 48 + #define HT_INFO(htd, ...) U_LOG_XDEV_IFL_I(&htd->base, htd->log_level, __VA_ARGS__) 49 + #define HT_WARN(htd, ...) U_LOG_XDEV_IFL_W(&htd->base, htd->log_level, __VA_ARGS__) 50 + #define HT_ERROR(htd, ...) U_LOG_XDEV_IFL_E(&htd->base, htd->log_level, __VA_ARGS__) 51 51 52 52 // #define ht_ 53 53 ··· 363 363 364 364 365 365 366 - enum u_logging_level ll; 366 + enum u_logging_level log_level; 367 367 }; 368 368 369 369 static inline struct ht_device *
+11 -11
src/xrt/drivers/hydra/hydra_driver.c
··· 39 39 * 40 40 */ 41 41 42 - #define HYDRA_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->sys->ll, __VA_ARGS__) 43 - #define HYDRA_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->sys->ll, __VA_ARGS__) 44 - #define HYDRA_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->sys->ll, __VA_ARGS__) 45 - #define HYDRA_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->sys->ll, __VA_ARGS__) 46 - #define HYDRA_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->sys->ll, __VA_ARGS__) 42 + #define HYDRA_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->sys->log_level, __VA_ARGS__) 43 + #define HYDRA_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->sys->log_level, __VA_ARGS__) 44 + #define HYDRA_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->sys->log_level, __VA_ARGS__) 45 + #define HYDRA_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->sys->log_level, __VA_ARGS__) 46 + #define HYDRA_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->sys->log_level, __VA_ARGS__) 47 47 48 48 DEBUG_GET_ONCE_LOG_OPTION(hydra_log, "HYDRA_LOG", U_LOGGING_WARN) 49 49 ··· 157 157 bool was_in_gamepad_mode; 158 158 int motion_attempt_number; 159 159 160 - enum u_logging_level ll; 160 + enum u_logging_level log_level; 161 161 }; 162 162 163 163 /*! ··· 328 328 return got_message ? 1 : 0; 329 329 } 330 330 if (ret != 52) { 331 - U_LOG_IFL_E(hs->ll, "Unexpected data report of size %d", ret); 331 + U_LOG_IFL_E(hs->log_level, "Unexpected data report of size %d", ret); 332 332 return -1; 333 333 } 334 334 got_message = true; ··· 348 348 } 349 349 350 350 hs->report_time = now; 351 - U_LOG_IFL_T(hs->ll, 351 + U_LOG_IFL_T(hs->log_level, 352 352 "\n\t" 353 353 "missed: %s\n\t" 354 354 "seq_no: %x\n", ··· 369 369 370 370 hs->was_in_gamepad_mode = true; 371 371 hs->motion_attempt_number++; 372 - U_LOG_IFL_D(hs->ll, 372 + U_LOG_IFL_D(hs->log_level, 373 373 "Setting feature report to start motion-controller mode, " 374 374 "attempt %d", 375 375 hs->motion_attempt_number); ··· 526 526 if (hs->data_hid != NULL && hs->command_hid != NULL && hs->sm.current_state == HYDRA_SM_REPORTING && 527 527 hs->was_in_gamepad_mode) { 528 528 529 - U_LOG_IFL_D(hs->ll, 529 + U_LOG_IFL_D(hs->log_level, 530 530 "hydra: Sending command to re-enter gamepad mode " 531 531 "and pausing while it takes effect."); 532 532 ··· 613 613 hs->report_counter = -1; 614 614 hs->refs = 2; 615 615 616 - hs->ll = debug_get_log_option_hydra_log(); 616 + hs->log_level = debug_get_log_option_hydra_log(); 617 617 618 618 // Populate the individual devices 619 619 for (size_t i = 0; i < 2; ++i) {
+7 -7
src/xrt/drivers/multi_wrapper/multi.c
··· 16 16 17 17 DEBUG_GET_ONCE_LOG_OPTION(multi_log, "MULTI_LOG", U_LOGGING_WARN) 18 18 19 - #define MULTI_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->ll, __VA_ARGS__) 20 - #define MULTI_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->ll, __VA_ARGS__) 21 - #define MULTI_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->ll, __VA_ARGS__) 22 - #define MULTI_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->ll, __VA_ARGS__) 23 - #define MULTI_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->ll, __VA_ARGS__) 19 + #define MULTI_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->log_level, __VA_ARGS__) 20 + #define MULTI_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->log_level, __VA_ARGS__) 21 + #define MULTI_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->log_level, __VA_ARGS__) 22 + #define MULTI_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->log_level, __VA_ARGS__) 23 + #define MULTI_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->log_level, __VA_ARGS__) 24 24 25 25 struct multi_device 26 26 { 27 27 struct xrt_device base; 28 - enum u_logging_level ll; 28 + enum u_logging_level log_level; 29 29 30 30 struct 31 31 { ··· 224 224 return NULL; 225 225 } 226 226 227 - d->ll = debug_get_log_option_multi_log(); 227 + d->log_level = debug_get_log_option_multi_log(); 228 228 d->override_type = override_type; 229 229 230 230 // mimic the tracking override target
+1 -1
src/xrt/drivers/north_star/ns_hmd.c
··· 540 540 enum u_device_alloc_flags flags = 541 541 (enum u_device_alloc_flags)(U_DEVICE_ALLOC_HMD | U_DEVICE_ALLOC_TRACKING_NONE); 542 542 struct ns_hmd *ns = U_DEVICE_ALLOCATE(struct ns_hmd, flags, 1, 0); 543 - ns->ll = debug_get_log_option_ns_log(); 543 + ns->log_level = debug_get_log_option_ns_log(); 544 544 545 545 if (!ns_config_load(ns, config_path)) 546 546 goto cleanup; // don't need to print any error, ns_config_load did that for us
+6 -6
src/xrt/drivers/north_star/ns_hmd.h
··· 33 33 * 34 34 */ 35 35 36 - #define NS_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->ll, __VA_ARGS__) 37 - #define NS_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->ll, __VA_ARGS__) 38 - #define NS_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->ll, __VA_ARGS__) 39 - #define NS_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->ll, __VA_ARGS__) 40 - #define NS_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->ll, __VA_ARGS__) 36 + #define NS_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->log_level, __VA_ARGS__) 37 + #define NS_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->log_level, __VA_ARGS__) 38 + #define NS_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->log_level, __VA_ARGS__) 39 + #define NS_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->log_level, __VA_ARGS__) 40 + #define NS_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->log_level, __VA_ARGS__) 41 41 42 42 /* 43 43 * ··· 116 116 struct u_ns_vipd_values dist_vipd; 117 117 }; 118 118 119 - enum u_logging_level ll; 119 + enum u_logging_level log_level; 120 120 }; 121 121 122 122 /*
+5 -5
src/xrt/drivers/ohmd/oh_device.c
··· 130 130 int64_t last_update; 131 131 struct xrt_space_relation last_relation; 132 132 133 - enum u_logging_level ll; 133 + enum u_logging_level log_level; 134 134 bool enable_finite_difference; 135 135 136 136 struct ··· 722 722 ohd->base.name = XRT_DEVICE_GENERIC_HMD; 723 723 ohd->ctx = ctx; 724 724 ohd->dev = dev; 725 - ohd->ll = debug_get_log_option_ohmd_log(); 725 + ohd->log_level = debug_get_log_option_ohmd_log(); 726 726 ohd->enable_finite_difference = debug_get_bool_option_ohmd_finite_diff(); 727 727 if (strcmp(prod, "Rift (CV1)") == 0 || strcmp(prod, "Rift S") == 0) { 728 728 ohd->ohmd_device_type = OPENHMD_OCULUS_RIFT_HMD; ··· 992 992 os_nanosleep(time_s_to_ns(1.0)); 993 993 } 994 994 995 - if (ohd->ll <= U_LOGGING_DEBUG) { 995 + if (ohd->log_level <= U_LOGGING_DEBUG) { 996 996 u_device_dump_config(&ohd->base, __func__, prod); 997 997 } 998 998 ··· 1001 1001 ohd->base.device_type = XRT_DEVICE_TYPE_HMD; 1002 1002 1003 1003 1004 - if (ohd->ll <= U_LOGGING_DEBUG) { 1004 + if (ohd->log_level <= U_LOGGING_DEBUG) { 1005 1005 u_device_dump_config(&ohd->base, __func__, prod); 1006 1006 } 1007 1007 ··· 1047 1047 } 1048 1048 ohd->ctx = ctx; 1049 1049 ohd->dev = dev; 1050 - ohd->ll = debug_get_log_option_ohmd_log(); 1050 + ohd->log_level = debug_get_log_option_ohmd_log(); 1051 1051 ohd->enable_finite_difference = debug_get_bool_option_ohmd_finite_diff(); 1052 1052 1053 1053 for (int i = 0; i < CONTROL_MAPPING_SIZE; i++) {
+5 -5
src/xrt/drivers/ohmd/oh_device.h
··· 19 19 int 20 20 oh_device_create(ohmd_context *ctx, bool no_hmds, struct xrt_device **out_xdevs); 21 21 22 - #define OHMD_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->ll, __VA_ARGS__) 23 - #define OHMD_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->ll, __VA_ARGS__) 24 - #define OHMD_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->ll, __VA_ARGS__) 25 - #define OHMD_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->ll, __VA_ARGS__) 26 - #define OHMD_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->ll, __VA_ARGS__) 22 + #define OHMD_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->log_level, __VA_ARGS__) 23 + #define OHMD_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->log_level, __VA_ARGS__) 24 + #define OHMD_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->log_level, __VA_ARGS__) 25 + #define OHMD_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->log_level, __VA_ARGS__) 26 + #define OHMD_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->log_level, __VA_ARGS__) 27 27 28 28 29 29 #ifdef __cplusplus
+7 -7
src/xrt/drivers/qwerty/qwerty_device.c
··· 43 43 #define QWERTY_AIM 3 44 44 #define QWERTY_VIBRATION 0 45 45 46 - #define QWERTY_TRACE(qd, ...) U_LOG_XDEV_IFL_T(&qd->base, qd->sys->ll, __VA_ARGS__) 47 - #define QWERTY_DEBUG(qd, ...) U_LOG_XDEV_IFL_D(&qd->base, qd->sys->ll, __VA_ARGS__) 48 - #define QWERTY_INFO(qd, ...) U_LOG_XDEV_IFL_I(&qd->base, qd->sys->ll, __VA_ARGS__) 49 - #define QWERTY_WARN(qd, ...) U_LOG_XDEV_IFL_W(&qd->base, qd->sys->ll, __VA_ARGS__) 50 - #define QWERTY_ERROR(qd, ...) U_LOG_XDEV_IFL_E(&qd->base, qd->sys->ll, __VA_ARGS__) 46 + #define QWERTY_TRACE(qd, ...) U_LOG_XDEV_IFL_T(&qd->base, qd->sys->log_level, __VA_ARGS__) 47 + #define QWERTY_DEBUG(qd, ...) U_LOG_XDEV_IFL_D(&qd->base, qd->sys->log_level, __VA_ARGS__) 48 + #define QWERTY_INFO(qd, ...) U_LOG_XDEV_IFL_I(&qd->base, qd->sys->log_level, __VA_ARGS__) 49 + #define QWERTY_WARN(qd, ...) U_LOG_XDEV_IFL_W(&qd->base, qd->sys->log_level, __VA_ARGS__) 50 + #define QWERTY_ERROR(qd, ...) U_LOG_XDEV_IFL_E(&qd->base, qd->sys->log_level, __VA_ARGS__) 51 51 52 52 static void 53 53 qwerty_system_remove(struct qwerty_system *qs, struct qwerty_device *qd); ··· 328 328 struct qwerty_device *qd_right = &qs->rctrl->base; 329 329 330 330 u_var_add_root(qs, "Qwerty System", true); 331 - u_var_add_log_level(qs, &qs->ll, "log_level"); 331 + u_var_add_log_level(qs, &qs->log_level, "Log level"); 332 332 u_var_add_bool(qs, &qs->process_keys, "process_keys"); 333 333 334 334 u_var_add_ro_text(qs, "", "Focused Device"); ··· 384 384 qs->hmd = qhmd; 385 385 qs->lctrl = qleft; 386 386 qs->rctrl = qright; 387 - qs->ll = log_level; 387 + qs->log_level = log_level; 388 388 qs->process_keys = true; 389 389 390 390 if (qhmd) {
+1 -1
src/xrt/drivers/qwerty/qwerty_device.h
··· 36 36 struct qwerty_hmd *hmd; //!< Can be NULL 37 37 struct qwerty_controller *lctrl; //!< Cannot be NULL 38 38 struct qwerty_controller *rctrl; //!< Cannot be NULL 39 - enum u_logging_level ll; 39 + enum u_logging_level log_level; 40 40 bool process_keys; //!< If false disable keyboard and mouse input 41 41 bool hmd_focused; //!< For gui var tracking only, true if hmd is the focused device 42 42 bool lctrl_focused; //!< Same as `hmd_focused` but for the left controller
+13 -13
src/xrt/drivers/realsense/rs_hdev.c
··· 55 55 #define RS_SOURCE_STR "RealSense Source" 56 56 #define RS_HOST_SLAM_TRACKER_STR "Host SLAM Tracker for RealSense" 57 57 58 - #define RS_TRACE(r, ...) U_LOG_IFL_T(r->ll, __VA_ARGS__) 59 - #define RS_DEBUG(r, ...) U_LOG_IFL_D(r->ll, __VA_ARGS__) 60 - #define RS_INFO(r, ...) U_LOG_IFL_I(r->ll, __VA_ARGS__) 61 - #define RS_WARN(r, ...) U_LOG_IFL_W(r->ll, __VA_ARGS__) 62 - #define RS_ERROR(r, ...) U_LOG_IFL_E(r->ll, __VA_ARGS__) 58 + #define RS_TRACE(r, ...) U_LOG_IFL_T(r->log_level, __VA_ARGS__) 59 + #define RS_DEBUG(r, ...) U_LOG_IFL_D(r->log_level, __VA_ARGS__) 60 + #define RS_INFO(r, ...) U_LOG_IFL_I(r->log_level, __VA_ARGS__) 61 + #define RS_WARN(r, ...) U_LOG_IFL_W(r->log_level, __VA_ARGS__) 62 + #define RS_ERROR(r, ...) U_LOG_IFL_E(r->log_level, __VA_ARGS__) 63 63 #define RS_ASSERT(predicate, ...) \ 64 64 do { \ 65 65 bool p = predicate; \ ··· 114 114 { 115 115 struct xrt_device xdev; 116 116 struct xrt_tracked_slam *slam; 117 - struct xrt_pose pose; //!< Device pose 118 - struct xrt_pose offset; //!< Additional offset to apply to `pose` 119 - enum u_logging_level ll; //!< Log level 117 + struct xrt_pose pose; //!< Device pose 118 + struct xrt_pose offset; //!< Additional offset to apply to `pose` 119 + enum u_logging_level log_level; //!< Log level 120 120 }; 121 121 122 122 /*! ··· 129 129 { 130 130 struct xrt_fs xfs; 131 131 struct xrt_frame_node node; 132 - enum u_logging_level ll; //!< Log level 132 + enum u_logging_level log_level; //!< Log level 133 133 134 134 // Sinks 135 135 struct xrt_frame_sink left_sink; //!< Intermediate sink for left camera frames ··· 904 904 rs_hdev_create(struct xrt_prober *xp, int device_idx) 905 905 { 906 906 struct rs_hdev *rh = U_DEVICE_ALLOCATE(struct rs_hdev, U_DEVICE_ALLOC_TRACKING_NONE, 1, 0); 907 - rh->ll = debug_get_log_option_rs_log(); 907 + rh->log_level = debug_get_log_option_rs_log(); 908 908 rh->pose = (struct xrt_pose){{0, 0, 0, 1}, {0, 0, 0}}; 909 909 rh->offset = (struct xrt_pose){{0, 0, 0, 1}, {0, 0, 0}}; 910 910 ··· 930 930 // Setup UI 931 931 u_var_add_root(rh, "RealSense Device", false); 932 932 u_var_add_ro_text(rh, "Host SLAM", "Tracked by"); 933 - u_var_add_log_level(rh, &rh->ll, "Log Level"); 933 + u_var_add_log_level(rh, &rh->log_level, "Log Level"); 934 934 u_var_add_pose(rh, &rh->pose, "SLAM Pose"); 935 935 u_var_add_pose(rh, &rh->offset, "Offset Pose"); 936 936 ··· 951 951 rs_source_create(struct xrt_frame_context *xfctx, int device_idx) 952 952 { 953 953 struct rs_source *rs = U_TYPED_CALLOC(struct rs_source); 954 - rs->ll = debug_get_log_option_rs_log(); 954 + rs->log_level = debug_get_log_option_rs_log(); 955 955 956 956 // Setup xrt_fs 957 957 struct xrt_fs *xfs = &rs->xfs; ··· 1017 1017 m_ff_vec3_f32_alloc(&rs->gyro_ff, 1000); 1018 1018 m_ff_vec3_f32_alloc(&rs->accel_ff, 1000); 1019 1019 u_var_add_root(rs, "RealSense Source", false); 1020 - u_var_add_log_level(rs, &rs->ll, "Log Level"); 1020 + u_var_add_log_level(rs, &rs->log_level, "Log Level"); 1021 1021 u_var_add_ro_ff_vec3_f32(rs, rs->gyro_ff, "Gyroscope"); 1022 1022 u_var_add_ro_ff_vec3_f32(rs, rs->accel_ff, "Accelerometer"); 1023 1023 u_var_add_sink_debug(rs, &rs->ui_left_sink, "Left Camera");
+36 -35
src/xrt/drivers/survive/survive_driver.c
··· 67 67 // initializing survive_driver once creates xrt_devices for all connected devices 68 68 static bool survive_already_initialized = false; 69 69 70 - #define SURVIVE_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->sys->ll, __VA_ARGS__) 71 - #define SURVIVE_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->sys->ll, __VA_ARGS__) 72 - #define SURVIVE_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->sys->ll, __VA_ARGS__) 73 - #define SURVIVE_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->sys->ll, __VA_ARGS__) 74 - #define SURVIVE_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->sys->ll, __VA_ARGS__) 70 + #define SURVIVE_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->sys->log_level, __VA_ARGS__) 71 + #define SURVIVE_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->sys->log_level, __VA_ARGS__) 72 + #define SURVIVE_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->sys->log_level, __VA_ARGS__) 73 + #define SURVIVE_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->sys->log_level, __VA_ARGS__) 74 + #define SURVIVE_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->sys->log_level, __VA_ARGS__) 75 75 76 76 struct survive_system; 77 77 ··· 165 165 SurviveSimpleContext *ctx; 166 166 struct survive_device *hmd; 167 167 struct survive_device *controllers[MAX_TRACKED_DEVICE_COUNT]; 168 - enum u_logging_level ll; 168 + enum u_logging_level log_level; 169 169 170 170 float wait_timeout; 171 171 ··· 742 742 743 743 struct survive_device *event_device = get_device_by_object(ss, e->object); 744 744 if (event_device == NULL) { 745 - U_LOG_IFL_I(ss->ll, "Event for unknown object not handled"); 745 + U_LOG_IFL_I(ss->log_level, "Event for unknown object not handled"); 746 746 return; 747 747 } 748 748 ··· 759 759 const struct SurviveSimpleConfigEvent *e = survive_simple_get_config_event(event); 760 760 enum SurviveSimpleObject_type t = survive_simple_object_get_type(e->object); 761 761 const char *name = survive_simple_object_name(e->object); 762 - U_LOG_IFL_D(ss->ll, "Processing config for object name %s: type %d", name, t); 762 + U_LOG_IFL_D(ss->log_level, "Processing config for object name %s: type %d", name, t); 763 763 add_device(ss, e); 764 764 break; 765 765 } ··· 768 768 769 769 struct survive_device *event_device = get_device_by_object(ss, e->object); 770 770 if (event_device == NULL) { 771 - U_LOG_IFL_E(ss->ll, "Event for unknown object not handled"); 771 + U_LOG_IFL_E(ss->log_level, "Event for unknown object not handled"); 772 772 return; 773 773 } 774 774 ··· 776 776 break; 777 777 } 778 778 case SurviveSimpleEventType_DeviceAdded: { 779 - U_LOG_IFL_W(ss->ll, "Device added event, but hotplugging not implemented yet"); 779 + U_LOG_IFL_W(ss->log_level, "Device added event, but hotplugging not implemented yet"); 780 780 break; 781 781 } 782 782 case SurviveSimpleEventType_None: break; 783 - default: U_LOG_IFL_E(ss->ll, "Unknown event %d", event->event_type); 783 + default: U_LOG_IFL_E(ss->log_level, "Unknown event %d", event->event_type); 784 784 } 785 785 } 786 786 ··· 815 815 816 816 struct survive_device *survive = U_DEVICE_ALLOCATE(struct survive_device, flags, inputs, outputs); 817 817 818 - if (!vive_config_parse(&survive->hmd.config, conf_str, sys->ll)) { 818 + if (!vive_config_parse(&survive->hmd.config, conf_str, sys->log_level)) { 819 819 free(survive); 820 820 return false; 821 821 } ··· 1000 1000 } else if (sys->controllers[SURVIVE_RIGHT_CONTROLLER_INDEX] == NULL) { 1001 1001 idx = SURVIVE_RIGHT_CONTROLLER_INDEX; 1002 1002 } else { 1003 - U_LOG_IFL_E(sys->ll, "Only creating 2 controllers!"); 1003 + U_LOG_IFL_E(sys->log_level, "Only creating 2 controllers!"); 1004 1004 return false; 1005 1005 } 1006 1006 } else if (variant == CONTROLLER_INDEX_LEFT) { 1007 1007 if (sys->controllers[SURVIVE_LEFT_CONTROLLER_INDEX] == NULL) { 1008 1008 idx = SURVIVE_LEFT_CONTROLLER_INDEX; 1009 1009 } else { 1010 - U_LOG_IFL_E(sys->ll, "Only creating 1 left controller!"); 1010 + U_LOG_IFL_E(sys->log_level, "Only creating 1 left controller!"); 1011 1011 return false; 1012 1012 } 1013 1013 } else if (variant == CONTROLLER_INDEX_RIGHT) { 1014 1014 if (sys->controllers[SURVIVE_RIGHT_CONTROLLER_INDEX] == NULL) { 1015 1015 idx = SURVIVE_RIGHT_CONTROLLER_INDEX; 1016 1016 } else { 1017 - U_LOG_IFL_E(sys->ll, "Only creating 1 right controller!"); 1017 + U_LOG_IFL_E(sys->log_level, "Only creating 1 right controller!"); 1018 1018 return false; 1019 1019 } 1020 1020 } else if (variant == CONTROLLER_TRACKER_GEN1 || variant == CONTROLLER_TRACKER_GEN2) { ··· 1027 1027 } 1028 1028 1029 1029 if (idx == -1) { 1030 - U_LOG_IFL_E(sys->ll, "Skipping survive device we couldn't assign: %s!", config->firmware.model_number); 1030 + U_LOG_IFL_E(sys->log_level, "Skipping survive device we couldn't assign: %s!", 1031 + config->firmware.model_number); 1031 1032 return false; 1032 1033 } 1033 1034 ··· 1160 1161 { 1161 1162 struct SurviveSimpleObject *sso = e->object; 1162 1163 1163 - U_LOG_IFL_D(ss->ll, "Got device config from survive"); 1164 + U_LOG_IFL_D(ss->log_level, "Got device config from survive"); 1164 1165 1165 1166 enum SurviveSimpleObject_type type = survive_simple_object_get_type(sso); 1166 1167 ··· 1172 1173 1173 1174 } else if (type == SurviveSimpleObject_OBJECT) { 1174 1175 struct vive_controller_config config = {0}; 1175 - vive_config_parse_controller(&config, conf_str, ss->ll); 1176 + vive_config_parse_controller(&config, conf_str, ss->log_level); 1176 1177 1177 1178 switch (config.variant) { 1178 1179 case CONTROLLER_VIVE_WAND: ··· 1180 1181 case CONTROLLER_INDEX_RIGHT: 1181 1182 case CONTROLLER_TRACKER_GEN1: 1182 1183 case CONTROLLER_TRACKER_GEN2: 1183 - U_LOG_IFL_D(ss->ll, "Adding controller: %s.", config.firmware.model_number); 1184 + U_LOG_IFL_D(ss->log_level, "Adding controller: %s.", config.firmware.model_number); 1184 1185 _create_controller_device(ss, sso, &config); 1185 1186 break; 1186 1187 default: 1187 - U_LOG_IFL_D(ss->ll, "Skip non controller obj %s.", config.firmware.model_number); 1188 - U_LOG_IFL_T(ss->ll, "json: %s", conf_str); 1188 + U_LOG_IFL_D(ss->log_level, "Skip non controller obj %s.", config.firmware.model_number); 1189 + U_LOG_IFL_T(ss->log_level, "json: %s", conf_str); 1189 1190 break; 1190 1191 } 1191 1192 } else { 1192 - U_LOG_IFL_D(ss->ll, "Skip non OBJECT obj."); 1193 + U_LOG_IFL_D(ss->log_level, "Skip non OBJECT obj."); 1193 1194 } 1194 1195 } 1195 1196 ··· 1203 1204 os_nanosleep(250 * 1000 * 1000); 1204 1205 1205 1206 size_t objs = survive_simple_get_object_count(ss->ctx); 1206 - U_LOG_IFL_D(ss->ll, "Object count: %zu", objs); 1207 + U_LOG_IFL_D(ss->log_level, "Object count: %zu", objs); 1207 1208 1208 1209 timepoint_ns start = os_monotonic_get_ns(); 1209 1210 ··· 1216 1217 sso = survive_simple_get_next_object(ss->ctx, sso)) { 1217 1218 enum SurviveSimpleObject_type t = survive_simple_object_get_type(sso); 1218 1219 const char *name = survive_simple_object_name(sso); 1219 - U_LOG_IFL_D(ss->ll, "Object name %s: type %d", name, t); 1220 + U_LOG_IFL_D(ss->log_level, "Object name %s: type %d", name, t); 1220 1221 1221 1222 // we only want to wait for configs of HMDs and controllers / trackers. 1222 1223 // Note: HMDs will be of type SurviveSimpleObject_OBJECT until the config is loaded. ··· 1225 1226 } 1226 1227 } 1227 1228 1228 - U_LOG_IFL_D(ss->ll, "Waiting for %d configs", configs_to_wait_for); 1229 + U_LOG_IFL_D(ss->log_level, "Waiting for %d configs", configs_to_wait_for); 1229 1230 while (configs_gotten < configs_to_wait_for) { 1230 1231 struct SurviveSimpleEvent event = {0}; 1231 1232 while (survive_simple_next_event(ss->ctx, &event) != SurviveSimpleEventType_None) { 1232 1233 if (event.event_type == SurviveSimpleEventType_ConfigEvent) { 1233 1234 _process_event(ss, &event); 1234 1235 configs_gotten++; 1235 - U_LOG_IFL_D(ss->ll, "Got config from device: %d/%d", configs_gotten, 1236 + U_LOG_IFL_D(ss->log_level, "Got config from device: %d/%d", configs_gotten, 1236 1237 configs_to_wait_for); 1237 1238 } else { 1238 - U_LOG_IFL_T(ss->ll, "Skipping event type %d", event.event_type); 1239 + U_LOG_IFL_T(ss->log_level, "Skipping event type %d", event.event_type); 1239 1240 } 1240 1241 } 1241 1242 1242 1243 if (time_ns_to_s(os_monotonic_get_ns() - start) > ss->wait_timeout) { 1243 - U_LOG_IFL_D(ss->ll, "Timed out after getting configs for %d/%d devices", configs_gotten, 1244 + U_LOG_IFL_D(ss->log_level, "Timed out after getting configs for %d/%d devices", configs_gotten, 1244 1245 configs_to_wait_for); 1245 1246 break; 1246 1247 } 1247 1248 os_nanosleep(500 * 1000); 1248 1249 } 1249 - U_LOG_IFL_D(ss->ll, "Waiting for configs took %f ms", time_ns_to_ms_f(os_monotonic_get_ns() - start)); 1250 + U_LOG_IFL_D(ss->log_level, "Waiting for configs took %f ms", time_ns_to_ms_f(os_monotonic_get_ns() - start)); 1250 1251 return true; 1251 1252 } 1252 1253 ··· 1352 1353 ss->base.offset.position.z = 0.0f; 1353 1354 ss->base.offset.orientation.w = 1.0f; 1354 1355 1355 - ss->ll = debug_get_log_option_survive_log(); 1356 + ss->log_level = debug_get_log_option_survive_log(); 1356 1357 1357 1358 survive_get_user_config(ss); 1358 1359 1359 1360 while (!add_connected_devices(ss)) { 1360 - U_LOG_IFL_E(ss->ll, "Failed to get device config from survive"); 1361 + U_LOG_IFL_E(ss->log_level, "Failed to get device config from survive"); 1361 1362 continue; 1362 1363 } 1363 1364 1364 1365 // U_LOG_D("Survive HMD %p, controller %p %p", (void *)ss->hmd, 1365 1366 // (void *)ss->controllers[0], (void *)ss->controllers[1]); 1366 1367 1367 - if (ss->ll <= U_LOGGING_DEBUG) { 1368 + if (ss->log_level <= U_LOGGING_DEBUG) { 1368 1369 if (ss->hmd) { 1369 1370 u_device_dump_config(&ss->hmd->base, __func__, "libsurvive"); 1370 1371 } ··· 1380 1381 for (int i = 0; i < MAX_TRACKED_DEVICE_COUNT; i++) { 1381 1382 1382 1383 if (out_idx == XRT_MAX_DEVICES_PER_PROBE - 1) { 1383 - U_LOG_IFL_W(ss->ll, "Probed max of %d devices, ignoring further devices", 1384 + U_LOG_IFL_W(ss->log_level, "Probed max of %d devices, ignoring further devices", 1384 1385 XRT_MAX_DEVICES_PER_PROBE); 1385 1386 return out_idx; 1386 1387 } ··· 1418 1419 // Mutex before thread. 1419 1420 int ret = os_mutex_init(&ss->lock); 1420 1421 if (ret != 0) { 1421 - U_LOG_IFL_E(ss->ll, "Failed to init mutex!"); 1422 + U_LOG_IFL_E(ss->log_level, "Failed to init mutex!"); 1422 1423 survive_device_destroy((struct xrt_device *)ss->hmd); 1423 1424 for (int i = 0; i < MAX_TRACKED_DEVICE_COUNT; i++) { 1424 1425 survive_device_destroy((struct xrt_device *)ss->controllers[i]); ··· 1428 1429 1429 1430 ret = os_thread_helper_start(&ss->event_thread, run_event_thread, ss); 1430 1431 if (ret != 0) { 1431 - U_LOG_IFL_E(ss->ll, "Failed to start event thread!"); 1432 + U_LOG_IFL_E(ss->log_level, "Failed to start event thread!"); 1432 1433 survive_device_destroy((struct xrt_device *)ss->hmd); 1433 1434 for (int i = 0; i < MAX_TRACKED_DEVICE_COUNT; i++) { 1434 1435 survive_device_destroy((struct xrt_device *)ss->controllers[i]);
+7 -7
src/xrt/drivers/ultraleap_v2/ulv2_driver.cpp
··· 23 23 24 24 DEBUG_GET_ONCE_LOG_OPTION(ulv2_log, "ULV2_LOG", U_LOGGING_INFO) 25 25 26 - #define ULV2_TRACE(ulv2d, ...) U_LOG_XDEV_IFL_T(&ulv2d->base, ulv2d->ll, __VA_ARGS__) 27 - #define ULV2_DEBUG(ulv2d, ...) U_LOG_XDEV_IFL_D(&ulv2d->base, ulv2d->ll, __VA_ARGS__) 28 - #define ULV2_INFO(ulv2d, ...) U_LOG_XDEV_IFL_I(&ulv2d->base, ulv2d->ll, __VA_ARGS__) 29 - #define ULV2_WARN(ulv2d, ...) U_LOG_XDEV_IFL_W(&ulv2d->base, ulv2d->ll, __VA_ARGS__) 30 - #define ULV2_ERROR(ulv2d, ...) U_LOG_XDEV_IFL_E(&ulv2d->base, ulv2d->ll, __VA_ARGS__) 26 + #define ULV2_TRACE(ulv2d, ...) U_LOG_XDEV_IFL_T(&ulv2d->base, ulv2d->log_level, __VA_ARGS__) 27 + #define ULV2_DEBUG(ulv2d, ...) U_LOG_XDEV_IFL_D(&ulv2d->base, ulv2d->log_level, __VA_ARGS__) 28 + #define ULV2_INFO(ulv2d, ...) U_LOG_XDEV_IFL_I(&ulv2d->base, ulv2d->log_level, __VA_ARGS__) 29 + #define ULV2_WARN(ulv2d, ...) U_LOG_XDEV_IFL_W(&ulv2d->base, ulv2d->log_level, __VA_ARGS__) 30 + #define ULV2_ERROR(ulv2d, ...) U_LOG_XDEV_IFL_E(&ulv2d->base, ulv2d->log_level, __VA_ARGS__) 31 31 32 32 #define printf_pose(pose) \ 33 33 printf("%f %f %f %f %f %f %f\n", pose.position.x, pose.position.y, pose.position.z, pose.orientation.x, \ ··· 53 53 54 54 struct xrt_tracking_origin tracking_origin; 55 55 56 - enum u_logging_level ll; 56 + enum u_logging_level log_level; 57 57 58 58 bool pthread_should_stop; 59 59 ··· 399 399 400 400 math_pose_identity(&ulv2d->base.tracking_origin->offset); 401 401 402 - ulv2d->ll = debug_get_log_option_ulv2_log(); 402 + ulv2d->log_level = debug_get_log_option_ulv2_log(); 403 403 404 404 ulv2d->base.update_inputs = ulv2_device_update_inputs; 405 405 ulv2d->base.get_hand_tracking = ulv2_device_get_hand_tracking;
+9 -9
src/xrt/drivers/v4l2/v4l2_driver.c
··· 44 44 * 45 45 */ 46 46 47 - #define V4L2_TRACE(d, ...) U_LOG_IFL_T(d->ll, __VA_ARGS__) 48 - #define V4L2_DEBUG(d, ...) U_LOG_IFL_D(d->ll, __VA_ARGS__) 49 - #define V4L2_INFO(d, ...) U_LOG_IFL_I(d->ll, __VA_ARGS__) 50 - #define V4L2_WARN(d, ...) U_LOG_IFL_W(d->ll, __VA_ARGS__) 51 - #define V4L2_ERROR(d, ...) U_LOG_IFL_E(d->ll, __VA_ARGS__) 47 + #define V4L2_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__) 48 + #define V4L2_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__) 49 + #define V4L2_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__) 50 + #define V4L2_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__) 51 + #define V4L2_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__) 52 52 53 53 #define V_CONTROL_GET(VID, CONTROL) \ 54 54 do { \ ··· 165 165 166 166 bool is_configured; 167 167 bool is_running; 168 - enum u_logging_level ll; 168 + enum u_logging_level log_level; 169 169 }; 170 170 171 171 /*! ··· 323 323 } 324 324 325 325 // Log controls. 326 - if (vid->ll <= U_LOGGING_DEBUG) { 326 + if (vid->log_level <= U_LOGGING_DEBUG) { 327 327 dump_controls(vid); 328 328 } 329 329 ··· 762 762 vid->base.is_running = v4l2_fs_is_running; 763 763 vid->node.break_apart = v4l2_fs_node_break_apart; 764 764 vid->node.destroy = v4l2_fs_node_destroy; 765 - vid->ll = debug_get_log_option_v4l2_log(); 765 + vid->log_level = debug_get_log_option_v4l2_log(); 766 766 vid->fd = -1; 767 767 768 768 snprintf(vid->base.product, sizeof(vid->base.product), "%s", product); ··· 792 792 u_sink_debug_init(&vid->usd); 793 793 u_var_add_root(vid, "V4L2 Frameserver", true); 794 794 u_var_add_ro_text(vid, vid->base.name, "Card"); 795 - u_var_add_ro_u32(vid, &vid->ll, "Log Level"); 795 + u_var_add_log_level(vid, &vid->log_level, "Log Level"); 796 796 for (size_t i = 0; i < vid->num_states; i++) { 797 797 u_var_add_i32(vid, &vid->states[i].want[0].value, vid->states[i].name); 798 798 }
+8 -8
src/xrt/drivers/vf/vf_driver.c
··· 44 44 * 45 45 */ 46 46 47 - #define VF_TRACE(d, ...) U_LOG_IFL_T(d->ll, __VA_ARGS__) 48 - #define VF_DEBUG(d, ...) U_LOG_IFL_D(d->ll, __VA_ARGS__) 49 - #define VF_INFO(d, ...) U_LOG_IFL_I(d->ll, __VA_ARGS__) 50 - #define VF_WARN(d, ...) U_LOG_IFL_W(d->ll, __VA_ARGS__) 51 - #define VF_ERROR(d, ...) U_LOG_IFL_E(d->ll, __VA_ARGS__) 47 + #define VF_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__) 48 + #define VF_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__) 49 + #define VF_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__) 50 + #define VF_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__) 51 + #define VF_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__) 52 52 53 53 DEBUG_GET_ONCE_LOG_OPTION(vf_log, "VF_LOG", U_LOGGING_WARN) 54 54 ··· 90 90 91 91 bool is_configured; 92 92 bool is_running; 93 - enum u_logging_level ll; 93 + enum u_logging_level log_level; 94 94 }; 95 95 96 96 /*! ··· 501 501 vid->base.is_running = vf_fs_is_running; 502 502 vid->node.break_apart = vf_fs_node_break_apart; 503 503 vid->node.destroy = vf_fs_node_destroy; 504 - vid->ll = debug_get_log_option_vf_log(); 504 + vid->log_level = debug_get_log_option_vf_log(); 505 505 506 506 // It's now safe to add it to the context. 507 507 xrt_frame_context_add(xfctx, &vid->node); ··· 510 510 // clang-format off 511 511 u_var_add_root(vid, "Video File Frameserver", true); 512 512 u_var_add_ro_text(vid, vid->base.name, "Card"); 513 - u_var_add_ro_u32(vid, &vid->ll, "Log Level"); 513 + u_var_add_log_level(vid, &vid->log_level, "Log Level"); 514 514 // clang-format on 515 515 516 516 return &(vid->base);
+5 -5
src/xrt/drivers/vive/vive.h
··· 16 16 * 17 17 */ 18 18 19 - #define VIVE_TRACE(d, ...) U_LOG_IFL_T(d->ll, __VA_ARGS__) 20 - #define VIVE_DEBUG(d, ...) U_LOG_IFL_D(d->ll, __VA_ARGS__) 21 - #define VIVE_INFO(d, ...) U_LOG_IFL_I(d->ll, __VA_ARGS__) 22 - #define VIVE_WARN(d, ...) U_LOG_IFL_W(d->ll, __VA_ARGS__) 23 - #define VIVE_ERROR(d, ...) U_LOG_IFL_E(d->ll, __VA_ARGS__) 19 + #define VIVE_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__) 20 + #define VIVE_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__) 21 + #define VIVE_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__) 22 + #define VIVE_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__) 23 + #define VIVE_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__)
+2 -2
src/xrt/drivers/vive/vive_controller.c
··· 1056 1056 struct vive_controller_device *d = 1057 1057 U_DEVICE_ALLOCATE(struct vive_controller_device, flags, VIVE_CONTROLLER_MAX_INDEX, 1); 1058 1058 1059 - d->ll = debug_get_log_option_vive_log(); 1059 + d->log_level = debug_get_log_option_vive_log(); 1060 1060 d->watchman_gen = WATCHMAN_GEN_UNKNOWN; 1061 1061 d->config.variant = CONTROLLER_UNKNOWN; 1062 1062 ··· 1101 1101 char *config = vive_read_config(d->controller_hid); 1102 1102 1103 1103 if (config != NULL) { 1104 - vive_config_parse_controller(&d->config, config, d->ll); 1104 + vive_config_parse_controller(&d->config, config, d->log_level); 1105 1105 free(config); 1106 1106 } else { 1107 1107 VIVE_ERROR(d, "Could not get Vive controller config\n");
+1 -1
src/xrt/drivers/vive/vive_controller.h
··· 68 68 69 69 struct xrt_quat rot_filtered; 70 70 71 - enum u_logging_level ll; 71 + enum u_logging_level log_level; 72 72 73 73 uint32_t last_ticks; 74 74
+3 -3
src/xrt/drivers/vive/vive_device.c
··· 764 764 d->base.name = XRT_DEVICE_GENERIC_HMD; 765 765 d->mainboard_dev = mainboard_dev; 766 766 d->sensors_dev = sensors_dev; 767 - d->ll = debug_get_log_option_vive_log(); 767 + d->log_level = debug_get_log_option_vive_log(); 768 768 d->watchman_dev = watchman_dev; 769 769 770 770 d->base.hmd->distortion.models = XRT_DISTORTION_MODEL_COMPUTE; ··· 796 796 797 797 char *config = vive_read_config(d->sensors_dev); 798 798 799 - d->config.ll = d->ll; 799 + d->config.log_level = d->log_level; 800 800 // usb connected HMD variant is known because of USB id, config parsing relies on it. 801 801 if (config != NULL) { 802 - vive_config_parse(&d->config, config, d->ll); 802 + vive_config_parse(&d->config, config, d->log_level); 803 803 free(config); 804 804 } 805 805
+1 -1
src/xrt/drivers/vive/vive_device.h
··· 61 61 struct xrt_quat rot_filtered; 62 62 struct m_relation_history *relation_hist; 63 63 64 - enum u_logging_level ll; 64 + enum u_logging_level log_level; 65 65 bool disconnect_notified; 66 66 67 67 struct
+7 -7
src/xrt/drivers/vive/vive_lighthouse.c
··· 20 20 21 21 #include "vive_lighthouse.h" 22 22 23 - static enum u_logging_level ll; 23 + static enum u_logging_level log_level; 24 24 25 - #define LH_TRACE(...) U_LOG_IFL_T(ll, __VA_ARGS__) 26 - #define LH_DEBUG(...) U_LOG_IFL_D(ll, __VA_ARGS__) 27 - #define LH_INFO(...) U_LOG_IFL_I(ll, __VA_ARGS__) 28 - #define LH_WARN(...) U_LOG_IFL_W(ll, __VA_ARGS__) 29 - #define LH_ERROR(...) U_LOG_IFL_E(ll, __VA_ARGS__) 25 + #define LH_TRACE(...) U_LOG_IFL_T(log_level, __VA_ARGS__) 26 + #define LH_DEBUG(...) U_LOG_IFL_D(log_level, __VA_ARGS__) 27 + #define LH_INFO(...) U_LOG_IFL_I(log_level, __VA_ARGS__) 28 + #define LH_WARN(...) U_LOG_IFL_W(log_level, __VA_ARGS__) 29 + #define LH_ERROR(...) U_LOG_IFL_E(log_level, __VA_ARGS__) 30 30 31 31 DEBUG_GET_ONCE_LOG_OPTION(vive_log, "VIVE_LOG", U_LOGGING_WARN) 32 32 ··· 538 538 watchman->last_timestamp = 0; 539 539 watchman->last_sync.timestamp = 0; 540 540 watchman->last_sync.duration = 0; 541 - ll = debug_get_log_option_vive_log(); 541 + log_level = debug_get_log_option_vive_log(); 542 542 }
+13 -13
src/xrt/drivers/vive/vive_prober.c
··· 64 64 struct xrt_prober_device *dev, 65 65 struct xrt_prober_device **devices, 66 66 size_t device_count, 67 - enum u_logging_level ll, 67 + enum u_logging_level log_level, 68 68 struct xrt_device **out_xdev) 69 69 { 70 - log_vive_device(ll, xp, dev); 70 + log_vive_device(log_level, xp, dev); 71 71 72 72 if (!xrt_prober_match_string(xp, dev, XRT_PROBER_STRING_MANUFACTURER, VIVE_MANUFACTURER_STRING) || 73 73 !xrt_prober_match_string(xp, dev, XRT_PROBER_STRING_PRODUCT, VIVE_PRODUCT_STRING)) { ··· 83 83 if (d->vendor_id != VALVE_VID && d->product_id != VIVE_LIGHTHOUSE_FPGA_RX) 84 84 continue; 85 85 86 - log_vive_device(ll, xp, d); 86 + log_vive_device(log_level, xp, d); 87 87 88 88 int result = xrt_prober_open_hid_interface(xp, d, 0, &sensors_dev); 89 89 if (result != 0) { ··· 135 135 struct xrt_prober_device *dev, 136 136 struct xrt_prober_device **devices, 137 137 size_t device_count, 138 - enum u_logging_level ll, 138 + enum u_logging_level log_level, 139 139 struct xrt_device **out_xdev) 140 140 { 141 141 XRT_TRACE_MARKER(); 142 142 143 - log_vive_device(ll, xp, dev); 143 + log_vive_device(log_level, xp, dev); 144 144 145 145 if (!xrt_prober_match_string(xp, dev, XRT_PROBER_STRING_MANUFACTURER, VIVE_MANUFACTURER_STRING) || 146 146 !xrt_prober_match_string(xp, dev, XRT_PROBER_STRING_PRODUCT, VIVE_PRO_PRODUCT_STRING)) { ··· 157 157 if (d->vendor_id != VALVE_VID && d->product_id != VIVE_PRO_LHR_PID) 158 158 continue; 159 159 160 - log_vive_device(ll, xp, d); 160 + log_vive_device(log_level, xp, d); 161 161 162 162 int result = xrt_prober_open_hid_interface(xp, d, 0, &sensors_dev); 163 163 if (result != 0) { ··· 209 209 struct xrt_prober_device *dev, 210 210 struct xrt_prober_device **devices, 211 211 size_t device_count, 212 - enum u_logging_level ll, 212 + enum u_logging_level log_level, 213 213 struct xrt_device **out_xdevs) 214 214 { 215 215 XRT_TRACE_MARKER(); 216 216 217 - log_vive_device(ll, xp, dev); 217 + log_vive_device(log_level, xp, dev); 218 218 219 219 if (!xrt_prober_match_string(xp, dev, XRT_PROBER_STRING_MANUFACTURER, VALVE_INDEX_MANUFACTURER_STRING) || 220 220 !xrt_prober_match_string(xp, dev, XRT_PROBER_STRING_PRODUCT, VALVE_INDEX_PRODUCT_STRING)) { ··· 292 292 293 293 struct xrt_prober_device *dev = devices[index]; 294 294 295 - enum u_logging_level ll = debug_get_log_option_vive_log(); 295 + enum u_logging_level log_level = debug_get_log_option_vive_log(); 296 296 297 - log_vive_device(ll, xp, dev); 297 + log_vive_device(log_level, xp, dev); 298 298 299 299 if (!xrt_prober_can_open(xp, dev)) { 300 300 U_LOG_E("Could not open Vive device."); ··· 302 302 } 303 303 304 304 switch (dev->product_id) { 305 - case VIVE_PID: return init_vive1(xp, dev, devices, device_count, ll, out_xdev); 306 - case VIVE_PRO_MAINBOARD_PID: return init_vive_pro(xp, dev, devices, device_count, ll, out_xdev); 307 - case VIVE_PRO_LHR_PID: return init_valve_index(xp, dev, devices, device_count, ll, out_xdev); 305 + case VIVE_PID: return init_vive1(xp, dev, devices, device_count, log_level, out_xdev); 306 + case VIVE_PRO_MAINBOARD_PID: return init_vive_pro(xp, dev, devices, device_count, log_level, out_xdev); 307 + case VIVE_PRO_LHR_PID: return init_valve_index(xp, dev, devices, device_count, log_level, out_xdev); 308 308 default: U_LOG_E("No product ids matched %.4x", dev->product_id); return -1; 309 309 } 310 310
+8 -8
src/xrt/drivers/wmr/wmr_bt_controller.c
··· 33 33 #include <unistd.h> // for sleep() 34 34 #endif 35 35 36 - #define WMR_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->ll, __VA_ARGS__) 37 - #define WMR_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->ll, __VA_ARGS__) 38 - #define WMR_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->ll, __VA_ARGS__) 39 - #define WMR_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->ll, __VA_ARGS__) 40 - #define WMR_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->ll, __VA_ARGS__) 36 + #define WMR_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->log_level, __VA_ARGS__) 37 + #define WMR_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->log_level, __VA_ARGS__) 38 + #define WMR_INFO(d, ...) U_LOG_XDEV_IFL_I(&d->base, d->log_level, __VA_ARGS__) 39 + #define WMR_WARN(d, ...) U_LOG_XDEV_IFL_W(&d->base, d->log_level, __VA_ARGS__) 40 + #define WMR_ERROR(d, ...) U_LOG_XDEV_IFL_E(&d->base, d->log_level, __VA_ARGS__) 41 41 42 42 #define SET_INPUT(NAME) (d->base.inputs[WMR_INDEX_##NAME].name = XRT_INPUT_WMR_##NAME) 43 43 ··· 69 69 switch (buffer[0]) { 70 70 case WMR_BT_MOTION_CONTROLLER_MSG: 71 71 // Note: skipping msg type byte 72 - if (!wmr_controller_packet_parse(&buffer[1], (size_t)size - 1, &d->controller_message, d->ll)) { 72 + if (!wmr_controller_packet_parse(&buffer[1], (size_t)size - 1, &d->controller_message, d->log_level)) { 73 73 WMR_ERROR(d, "WMR Controller (Bluetooth): Failed parsing message type: %02x, size: %i", 74 74 buffer[0], size); 75 75 return false; ··· 214 214 struct xrt_device * 215 215 wmr_bt_controller_create(struct os_hid_device *controller_hid, 216 216 enum xrt_device_type controller_type, 217 - enum u_logging_level ll) 217 + enum u_logging_level log_level) 218 218 { 219 219 220 220 enum u_device_alloc_flags flags = U_DEVICE_ALLOC_TRACKING_NONE; 221 221 struct wmr_bt_controller *d = U_DEVICE_ALLOCATE(struct wmr_bt_controller, flags, 10, 1); 222 222 223 - d->ll = ll; 223 + d->log_level = log_level; 224 224 d->controller_hid = controller_hid; 225 225 226 226 if (controller_type == XRT_DEVICE_TYPE_LEFT_HAND_CONTROLLER) {
+2 -2
src/xrt/drivers/wmr/wmr_bt_controller.h
··· 66 66 67 67 struct xrt_quat rot_filtered; 68 68 69 - enum u_logging_level ll; 69 + enum u_logging_level log_level; 70 70 71 71 uint32_t last_ticks; 72 72 ··· 94 94 struct xrt_device * 95 95 wmr_bt_controller_create(struct os_hid_device *controller_hid, 96 96 enum xrt_device_type controller_type, 97 - enum u_logging_level ll); 97 + enum u_logging_level log_level); 98 98 99 99 100 100 #ifdef __cplusplus
+2 -2
src/xrt/drivers/wmr/wmr_camera.c
··· 303 303 */ 304 304 305 305 struct wmr_camera * 306 - wmr_camera_open(struct xrt_prober_device *dev_holo, enum u_logging_level ll) 306 + wmr_camera_open(struct xrt_prober_device *dev_holo, enum u_logging_level log_level) 307 307 { 308 308 struct wmr_camera *cam = calloc(1, sizeof(struct wmr_camera)); 309 309 int res, i; 310 310 311 - cam->log_level = ll; 311 + cam->log_level = log_level; 312 312 313 313 if (os_thread_helper_init(&cam->usb_thread) != 0) { 314 314 WMR_CAM_ERROR(cam, "Failed to initialise threading");
+1 -1
src/xrt/drivers/wmr/wmr_camera.h
··· 23 23 24 24 #ifdef XRT_HAVE_LIBUSB 25 25 struct wmr_camera * 26 - wmr_camera_open(struct xrt_prober_device *dev_holo, enum u_logging_level ll); 26 + wmr_camera_open(struct xrt_prober_device *dev_holo, enum u_logging_level log_level); 27 27 void 28 28 wmr_camera_free(struct wmr_camera *cam); 29 29
+48 -47
src/xrt/drivers/wmr/wmr_config.c
··· 15 15 16 16 #include "wmr_config.h" 17 17 18 - #define WMR_TRACE(ll, ...) U_LOG_IFL_T(ll, __VA_ARGS__) 19 - #define WMR_DEBUG(ll, ...) U_LOG_IFL_D(ll, __VA_ARGS__) 20 - #define WMR_INFO(ll, ...) U_LOG_IFL_I(ll, __VA_ARGS__) 21 - #define WMR_WARN(ll, ...) U_LOG_IFL_W(ll, __VA_ARGS__) 22 - #define WMR_ERROR(ll, ...) U_LOG_IFL_E(ll, __VA_ARGS__) 18 + #define WMR_TRACE(log_level, ...) U_LOG_IFL_T(log_level, __VA_ARGS__) 19 + #define WMR_DEBUG(log_level, ...) U_LOG_IFL_D(log_level, __VA_ARGS__) 20 + #define WMR_INFO(log_level, ...) U_LOG_IFL_I(log_level, __VA_ARGS__) 21 + #define WMR_WARN(log_level, ...) U_LOG_IFL_W(log_level, __VA_ARGS__) 22 + #define WMR_ERROR(log_level, ...) U_LOG_IFL_E(log_level, __VA_ARGS__) 23 23 24 24 #define JSON_INT(a, b, c) u_json_get_int(u_json_get(a, b), c) 25 25 #define JSON_FLOAT(a, b, c) u_json_get_float(u_json_get(a, b), c) ··· 60 60 } 61 61 62 62 static bool 63 - wmr_config_parse_display(struct wmr_hmd_config *c, cJSON *display, enum u_logging_level ll) 63 + wmr_config_parse_display(struct wmr_hmd_config *c, cJSON *display, enum u_logging_level log_level) 64 64 { 65 65 cJSON *json_eye = cJSON_GetObjectItem(display, "AssignedEye"); 66 66 char *json_eye_name = cJSON_GetStringValue(json_eye); 67 67 68 68 if (json_eye_name == NULL) { 69 - WMR_ERROR(ll, "Invalid/missing eye assignment block"); 69 + WMR_ERROR(log_level, "Invalid/missing eye assignment block"); 70 70 return false; 71 71 } 72 72 ··· 76 76 } else if (!strcmp(json_eye_name, "CALIBRATION_DisplayEyeRight")) { 77 77 eye = &c->eye_params[1]; 78 78 } else { 79 - WMR_ERROR(ll, "Unknown AssignedEye \"%s\"", json_eye_name); 79 + WMR_ERROR(log_level, "Unknown AssignedEye \"%s\"", json_eye_name); 80 80 return false; 81 81 } 82 82 83 83 /* Extract display panel parameters */ 84 84 cJSON *affine = cJSON_GetObjectItem(display, "Affine"); 85 85 if (affine == NULL || u_json_get_float_array(affine, eye->affine_xform.v, 9) != 9) { 86 - WMR_ERROR(ll, "Missing affine transform for AssignedEye \"%s\"", json_eye_name); 86 + WMR_ERROR(log_level, "Missing affine transform for AssignedEye \"%s\"", json_eye_name); 87 87 return false; 88 88 } 89 89 ··· 125 125 126 126 cJSON *dist = cJSON_GetObjectItemCaseSensitive(display, channel_names[channel]); 127 127 if (!dist) { 128 - WMR_ERROR(ll, "Missing distortion channel info %s", channel_names[channel]); 128 + WMR_ERROR(log_level, "Missing distortion channel info %s", channel_names[channel]); 129 129 return false; 130 130 } 131 131 132 132 const char *model_type = cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(dist, "ModelType")); 133 133 if (model_type == NULL) { 134 - WMR_ERROR(ll, "Missing distortion type"); 134 + WMR_ERROR(log_level, "Missing distortion type"); 135 135 return false; 136 136 } 137 137 ··· 139 139 distortion3K->model = WMR_DISTORTION_MODEL_POLYNOMIAL_3K; 140 140 } else { 141 141 distortion3K->model = WMR_DISTORTION_MODEL_UNKNOWN; 142 - WMR_ERROR(ll, "Unknown distortion model %s", model_type); 142 + WMR_ERROR(log_level, "Unknown distortion model %s", model_type); 143 143 return false; 144 144 } 145 145 ··· 147 147 double parameters[5]; 148 148 149 149 if (!JSON_INT(dist, "ModelParameterCount", &param_count)) { 150 - WMR_ERROR(ll, "Missing distortion parameters"); 150 + WMR_ERROR(log_level, "Missing distortion parameters"); 151 151 return false; 152 152 } 153 153 154 154 cJSON *params_json = cJSON_GetObjectItemCaseSensitive(dist, "ModelParameters"); 155 155 if (params_json == NULL || 156 156 u_json_get_double_array(params_json, parameters, param_count) != (size_t)param_count) { 157 - WMR_ERROR(ll, "Missing distortion parameters"); 157 + WMR_ERROR(log_level, "Missing distortion parameters"); 158 158 return false; 159 159 } 160 160 ··· 170 170 } 171 171 172 172 static bool 173 - wmr_config_parse_inertial_sensor(struct wmr_hmd_config *c, cJSON *sensor, enum u_logging_level ll) 173 + wmr_config_parse_inertial_sensor(struct wmr_hmd_config *c, cJSON *sensor, enum u_logging_level log_level) 174 174 { 175 175 struct xrt_pose *out_pose; 176 176 177 177 const char *sensor_type = cJSON_GetStringValue(cJSON_GetObjectItem(sensor, "SensorType")); 178 178 if (sensor_type == NULL) { 179 - WMR_WARN(ll, "Missing sensor type"); 179 + WMR_WARN(log_level, "Missing sensor type"); 180 180 return false; 181 181 } 182 182 ··· 187 187 } else if (!strcmp(sensor_type, "CALIBRATION_InertialSensorType_Magnetometer")) { 188 188 out_pose = &c->mag_pose; 189 189 } else { 190 - WMR_WARN(ll, "Unhandled sensor type \"%s\"", sensor_type); 190 + WMR_WARN(log_level, "Unhandled sensor type \"%s\"", sensor_type); 191 191 return false; 192 192 } 193 193 ··· 197 197 cJSON *rt = cJSON_GetObjectItem(sensor, "Rt"); 198 198 cJSON *rx = cJSON_GetObjectItem(rt, "Rotation"); 199 199 if (rt == NULL || rx == NULL) { 200 - WMR_WARN(ll, "Missing Inertial Sensor calibration"); 200 + WMR_WARN(log_level, "Missing Inertial Sensor calibration"); 201 201 return false; 202 202 } 203 203 204 204 if (!JSON_VEC3(rt, "Translation", &translation) || u_json_get_float_array(rx, rotation.v, 9) != 9) { 205 - WMR_WARN(ll, "Invalid Inertial Sensor calibration"); 205 + WMR_WARN(log_level, "Invalid Inertial Sensor calibration"); 206 206 return false; 207 207 } 208 208 ··· 212 212 } 213 213 214 214 static bool 215 - wmr_config_parse_camera_config(struct wmr_hmd_config *c, cJSON *camera, enum u_logging_level ll) 215 + wmr_config_parse_camera_config(struct wmr_hmd_config *c, cJSON *camera, enum u_logging_level log_level) 216 216 { 217 217 if (c->n_cameras == WMR_MAX_CAMERAS) { 218 - WMR_ERROR(ll, "Too many camera entries. Enlarge WMR_MAX_CAMERAS"); 218 + WMR_ERROR(log_level, "Too many camera entries. Enlarge WMR_MAX_CAMERAS"); 219 219 return false; 220 220 } 221 221 ··· 225 225 cJSON *json_purpose = cJSON_GetObjectItem(camera, "Purpose"); 226 226 char *json_purpose_name = cJSON_GetStringValue(json_purpose); 227 227 if (json_purpose_name == NULL) { 228 - WMR_ERROR(ll, "Invalid camera calibration block %d - unknown camera purpose %s", c->n_cameras, 228 + WMR_ERROR(log_level, "Invalid camera calibration block %d - unknown camera purpose %s", c->n_cameras, 229 229 json_purpose_name); 230 230 return false; 231 231 } ··· 235 235 } else if (!strcmp(json_purpose_name, "CALIBRATION_CameraPurposeDisplayObserver")) { 236 236 cam_config->purpose = WMR_CAMERA_PURPOSE_DISPLAY_OBSERVER; 237 237 } else { 238 - WMR_ERROR(ll, "Unknown camera purpose: \"%s\" (camera %d)", json_purpose_name, c->n_cameras); 238 + WMR_ERROR(log_level, "Unknown camera purpose: \"%s\" (camera %d)", json_purpose_name, c->n_cameras); 239 239 return false; 240 240 } 241 241 242 242 cJSON *json_location = cJSON_GetObjectItem(camera, "Location"); 243 243 char *json_location_name = cJSON_GetStringValue(json_location); 244 244 if (json_location_name == NULL) { 245 - WMR_ERROR(ll, "Invalid camera calibration block %d - location", c->n_cameras); 245 + WMR_ERROR(log_level, "Invalid camera calibration block %d - location", c->n_cameras); 246 246 return false; 247 247 } 248 248 ··· 259 259 } else if (!strcmp(json_location_name, "CALIBRATION_CameraLocationDO1")) { 260 260 cam_config->location = WMR_CAMERA_LOCATION_DO1; 261 261 } else { 262 - WMR_ERROR(ll, "Unknown camera location: \"%s\" (camera %d)", json_location_name, c->n_cameras); 262 + WMR_ERROR(log_level, "Unknown camera location: \"%s\" (camera %d)", json_location_name, c->n_cameras); 263 263 return false; 264 264 } 265 265 ··· 270 270 cJSON *rt = cJSON_GetObjectItem(camera, "Rt"); 271 271 cJSON *rx = cJSON_GetObjectItem(rt, "Rotation"); 272 272 if (rt == NULL || rx == NULL) { 273 - WMR_ERROR(ll, "Invalid camera calibration block %d - pose", c->n_cameras); 273 + WMR_ERROR(log_level, "Invalid camera calibration block %d - pose", c->n_cameras); 274 274 return false; 275 275 } 276 276 277 277 if (!JSON_VEC3(rt, "Translation", &translation) || u_json_get_float_array(rx, rotation.v, 9) != 9) { 278 - WMR_ERROR(ll, "Invalid camera calibration block %d - pose", c->n_cameras); 278 + WMR_ERROR(log_level, "Invalid camera calibration block %d - pose", c->n_cameras); 279 279 return false; 280 280 } 281 281 ··· 283 283 284 284 if (!JSON_INT(camera, "SensorWidth", &cam_config->sensor_width) || 285 285 !JSON_INT(camera, "SensorHeight", &cam_config->sensor_height)) { 286 - WMR_ERROR(ll, "Invalid camera calibration block %d - sensor size", c->n_cameras); 286 + WMR_ERROR(log_level, "Invalid camera calibration block %d - sensor size", c->n_cameras); 287 287 return false; 288 288 } 289 289 290 290 /* Distortion information */ 291 291 cJSON *dist = cJSON_GetObjectItemCaseSensitive(camera, "Intrinsics"); 292 292 if (!dist) { 293 - WMR_ERROR(ll, "Invalid camera calibration block %d - distortion", c->n_cameras); 293 + WMR_ERROR(log_level, "Invalid camera calibration block %d - distortion", c->n_cameras); 294 294 return false; 295 295 } 296 296 297 297 const char *model_type = cJSON_GetStringValue(cJSON_GetObjectItemCaseSensitive(dist, "ModelType")); 298 298 if (model_type == NULL) { 299 - WMR_ERROR(ll, "Invalid camera calibration block %d - missing distortion type", c->n_cameras); 299 + WMR_ERROR(log_level, "Invalid camera calibration block %d - missing distortion type", c->n_cameras); 300 300 return false; 301 301 } 302 302 303 303 if (!strcmp(model_type, "CALIBRATION_LensDistortionModelRational6KT")) { 304 304 } else { 305 - WMR_ERROR(ll, "Invalid camera calibration block %d - unknown distortion type %s", c->n_cameras, 305 + WMR_ERROR(log_level, "Invalid camera calibration block %d - unknown distortion type %s", c->n_cameras, 306 306 model_type); 307 307 return false; 308 308 } ··· 311 311 312 312 int param_count; 313 313 if (!JSON_INT(dist, "ModelParameterCount", &param_count)) { 314 - WMR_ERROR(ll, "Invalid camera calibration block %d - no ModelParameterCount", c->n_cameras); 314 + WMR_ERROR(log_level, "Invalid camera calibration block %d - no ModelParameterCount", c->n_cameras); 315 315 return false; 316 316 } 317 317 318 318 if (param_count != 15) { 319 - WMR_ERROR(ll, "Invalid camera calibration block %d - wrong ModelParameterCount %d", c->n_cameras, 319 + WMR_ERROR(log_level, "Invalid camera calibration block %d - wrong ModelParameterCount %d", c->n_cameras, 320 320 param_count); 321 321 return false; 322 322 } ··· 324 324 cJSON *params_json = cJSON_GetObjectItemCaseSensitive(dist, "ModelParameters"); 325 325 if (params_json == NULL || 326 326 u_json_get_float_array(params_json, distortion6KT->v, param_count) != (size_t)param_count) { 327 - WMR_ERROR(ll, "Invalid camera calibration block %d - missing distortion parameters", c->n_cameras); 327 + WMR_ERROR(log_level, "Invalid camera calibration block %d - missing distortion parameters", 328 + c->n_cameras); 328 329 return false; 329 330 } 330 331 ··· 333 334 } 334 335 335 336 static bool 336 - wmr_config_parse_calibration(struct wmr_hmd_config *c, cJSON *calib_info, enum u_logging_level ll) 337 + wmr_config_parse_calibration(struct wmr_hmd_config *c, cJSON *calib_info, enum u_logging_level log_level) 337 338 { 338 339 cJSON *item = NULL; 339 340 340 341 // calib_info is object with keys "Cameras", "Displays", and "InertialSensors" 341 342 cJSON *displays = cJSON_GetObjectItemCaseSensitive(calib_info, "Displays"); 342 343 if (!cJSON_IsArray(displays)) { 343 - WMR_ERROR(ll, "Displays: not found or not an Array"); 344 + WMR_ERROR(log_level, "Displays: not found or not an Array"); 344 345 return false; 345 346 } 346 347 347 348 cJSON_ArrayForEach(item, displays) 348 349 { 349 - if (!wmr_config_parse_display(c, item, ll)) { 350 - WMR_ERROR(ll, "Error parsing Display entry"); 350 + if (!wmr_config_parse_display(c, item, log_level)) { 351 + WMR_ERROR(log_level, "Error parsing Display entry"); 351 352 return false; 352 353 } 353 354 } 354 355 355 356 cJSON *sensors = cJSON_GetObjectItemCaseSensitive(calib_info, "InertialSensors"); 356 357 if (!cJSON_IsArray(sensors)) { 357 - WMR_ERROR(ll, "InertialSensors: not found or not an Array"); 358 + WMR_ERROR(log_level, "InertialSensors: not found or not an Array"); 358 359 return false; 359 360 } 360 361 361 362 cJSON_ArrayForEach(item, sensors) 362 363 { 363 - if (!wmr_config_parse_inertial_sensor(c, item, ll)) { 364 - WMR_WARN(ll, "Error parsing InertialSensor entry"); 364 + if (!wmr_config_parse_inertial_sensor(c, item, log_level)) { 365 + WMR_WARN(log_level, "Error parsing InertialSensor entry"); 365 366 } 366 367 } 367 368 368 369 cJSON *cameras = cJSON_GetObjectItemCaseSensitive(calib_info, "Cameras"); 369 370 if (!cJSON_IsArray(cameras)) { 370 - WMR_ERROR(ll, "Cameras: not found or not an Array"); 371 + WMR_ERROR(log_level, "Cameras: not found or not an Array"); 371 372 return false; 372 373 } 373 374 374 375 cJSON_ArrayForEach(item, cameras) 375 376 { 376 - if (!wmr_config_parse_camera_config(c, item, ll)) 377 + if (!wmr_config_parse_camera_config(c, item, log_level)) 377 378 return false; 378 379 } 379 380 ··· 382 383 383 384 384 385 bool 385 - wmr_config_parse(struct wmr_hmd_config *c, char *json_string, enum u_logging_level ll) 386 + wmr_config_parse(struct wmr_hmd_config *c, char *json_string, enum u_logging_level log_level) 386 387 { 387 388 wmr_config_init_defaults(c); 388 389 389 390 cJSON *json_root = cJSON_Parse(json_string); 390 391 if (!cJSON_IsObject(json_root)) { 391 - WMR_ERROR(ll, "Could not parse JSON data."); 392 + WMR_ERROR(log_level, "Could not parse JSON data."); 392 393 cJSON_Delete(json_root); 393 394 return false; 394 395 } 395 396 396 397 cJSON *calib_info = cJSON_GetObjectItemCaseSensitive(json_root, "CalibrationInformation"); 397 398 if (!cJSON_IsObject(calib_info)) { 398 - WMR_ERROR(ll, "CalibrationInformation object not found"); 399 + WMR_ERROR(log_level, "CalibrationInformation object not found"); 399 400 cJSON_Delete(json_root); 400 401 return false; 401 402 } 402 403 403 - bool res = wmr_config_parse_calibration(c, calib_info, ll); 404 + bool res = wmr_config_parse_calibration(c, calib_info, log_level); 404 405 405 406 cJSON_Delete(json_root); 406 407 return res;
+1 -1
src/xrt/drivers/wmr/wmr_config.h
··· 119 119 }; 120 120 121 121 bool 122 - wmr_config_parse(struct wmr_hmd_config *c, char *json_string, enum u_logging_level ll); 122 + wmr_config_parse(struct wmr_hmd_config *c, char *json_string, enum u_logging_level log_level); 123 123 124 124 125 125 struct wmr_bt_controller_config
+7 -7
src/xrt/drivers/wmr/wmr_controller_protocol.c
··· 23 23 wmr_controller_packet_parse(const unsigned char *buffer, 24 24 size_t len, 25 25 struct wmr_controller_message *out_message, 26 - enum u_logging_level ll) 26 + enum u_logging_level log_level) 27 27 { 28 28 if (len != 44) { 29 - U_LOG_IFL_E(ll, "WMR Controller: unexpected message length: %zd", len); 29 + U_LOG_IFL_E(log_level, "WMR Controller: unexpected message length: %zd", len); 30 30 return false; 31 31 } 32 32 33 - U_LOG_IFL_D(ll, 33 + U_LOG_IFL_D(log_level, 34 34 "%02x %02x %02x %02x %02x %02x %02x %02x | " // buttons and inputs, battery 35 35 "%02x %02x %02x %02x %02x %02x %02x %02x %02x | " // accel 36 36 "%02x %02x | " // temp ··· 75 75 read16(&p); 76 76 read16(&p); 77 77 78 - U_LOG_IFL_D(ll, "buttons: %02x, trigger: %02x, pad_x: %02x, pad_y: %02x", out_message->buttons, 78 + U_LOG_IFL_D(log_level, "buttons: %02x, trigger: %02x, pad_x: %02x, pad_y: %02x", out_message->buttons, 79 79 out_message->trigger, out_message->pad_x, out_message->pad_y); 80 80 81 81 /* 82 - U_LOG_IFL_D(ll, "timestamp %lu\ttemp %d\taccel x: %f\ty: %f\tz: %f\t\tgyro x: %f\tgyro y: %f\tgyro z: 83 - %f", timestamp, temp, accel_x * 0.001f, accel_y * 0.001f, accel_z * 0.001f, gyro_x * 2e-6, gyro_y * 2e-6, 84 - gyro_z * 2e-6); 82 + U_LOG_IFL_D(log_level, "timestamp %lu\ttemp %d\taccel x: %f\ty: %f\tz: %f\t\tgyro x: %f\tgyro y: 83 + %f\tgyro z: %f", timestamp, temp, accel_x * 0.001f, accel_y * 0.001f, accel_z * 0.001f, gyro_x * 2e-6, gyro_y 84 + * 2e-6, gyro_z * 2e-6); 85 85 */ 86 86 87 87 return true;
+1 -1
src/xrt/drivers/wmr/wmr_controller_protocol.h
··· 90 90 wmr_controller_packet_parse(const unsigned char *buffer, 91 91 size_t len, 92 92 struct wmr_controller_message *out_message, 93 - enum u_logging_level ll); 93 + enum u_logging_level log_level); 94 94 95 95 96 96 /*!
+2 -2
src/xrt/drivers/wmr/wmr_hmd.c
··· 891 891 struct os_hid_device *hid_holo, 892 892 struct os_hid_device *hid_ctrl, 893 893 struct wmr_camera *cam, 894 - enum u_logging_level ll) 894 + enum u_logging_level log_level) 895 895 { 896 896 enum u_device_alloc_flags flags = 897 897 (enum u_device_alloc_flags)(U_DEVICE_ALLOC_HMD | U_DEVICE_ALLOC_TRACKING_NONE); ··· 910 910 wh->base.destroy = wmr_hmd_destroy; 911 911 wh->base.name = XRT_DEVICE_GENERIC_HMD; 912 912 wh->base.device_type = XRT_DEVICE_TYPE_HMD; 913 - wh->log_level = ll; 913 + wh->log_level = log_level; 914 914 915 915 wh->base.orientation_tracking_supported = true; 916 916 wh->base.position_tracking_supported = false;
+1 -1
src/xrt/drivers/wmr/wmr_hmd.h
··· 147 147 struct os_hid_device *hid_holo, 148 148 struct os_hid_device *hid_ctrl, 149 149 struct wmr_camera *cam, 150 - enum u_logging_level ll); 150 + enum u_logging_level log_level); 151 151 152 152 #define WMR_TRACE(d, ...) U_LOG_XDEV_IFL_T(&d->base, d->log_level, __VA_ARGS__) 153 153 #define WMR_DEBUG(d, ...) U_LOG_XDEV_IFL_D(&d->base, d->log_level, __VA_ARGS__)
+19 -18
src/xrt/drivers/wmr/wmr_prober.c
··· 89 89 find_companion_device(struct xrt_prober *xp, 90 90 struct xrt_prober_device **devices, 91 91 size_t device_count, 92 - enum u_logging_level ll, 92 + enum u_logging_level log_level, 93 93 enum wmr_headset_type *out_hmd_type, 94 94 struct xrt_prober_device **out_device, 95 95 int *out_interface) ··· 116 116 } 117 117 118 118 if (dev != NULL) { 119 - U_LOG_IFL_W(ll, "Found multiple control devices, using the last."); 119 + U_LOG_IFL_W(log_level, "Found multiple control devices, using the last."); 120 120 } 121 121 dev = devices[i]; 122 122 } ··· 130 130 xrt_prober_get_string_descriptor(xp, dev, XRT_PROBER_STRING_MANUFACTURER, m_str, sizeof(m_str)); 131 131 xrt_prober_get_string_descriptor(xp, dev, XRT_PROBER_STRING_PRODUCT, p_str, sizeof(p_str)); 132 132 133 - U_LOG_IFL_D(ll, "Found Hololens Sensors' companion device '%s' '%s' (vid %04X, pid%04X)", p_str, m_str, 133 + U_LOG_IFL_D(log_level, "Found Hololens Sensors' companion device '%s' '%s' (vid %04X, pid%04X)", p_str, m_str, 134 134 dev->vendor_id, dev->product_id); 135 135 136 136 ··· 155 155 cJSON *attached_data, 156 156 struct xrt_device **out_xdev) 157 157 { 158 - enum u_logging_level ll = debug_get_log_option_wmr_log(); 158 + enum u_logging_level log_level = debug_get_log_option_wmr_log(); 159 159 160 160 struct xrt_prober_device *dev_holo = devices[index]; 161 161 struct xrt_prober_device *dev_companion = NULL; ··· 168 168 169 169 if (!xrt_prober_match_string(xp, dev_holo, XRT_PROBER_STRING_MANUFACTURER, MS_HOLOLENS_MANUFACTURER_STRING) || 170 170 !xrt_prober_match_string(xp, dev_holo, XRT_PROBER_STRING_PRODUCT, MS_HOLOLENS_PRODUCT_STRING)) { 171 - U_LOG_IFL_E(ll, "HoloLens Sensors manufacturer or product strings did not match"); 171 + U_LOG_IFL_E(log_level, "HoloLens Sensors manufacturer or product strings did not match"); 172 172 return -1; 173 173 } 174 174 175 - U_LOG_IFL_D(ll, "Found HoloLens Sensors HMD device '%s' '%s' (vid %04X, pid %04X)", 175 + U_LOG_IFL_D(log_level, "Found HoloLens Sensors HMD device '%s' '%s' (vid %04X, pid %04X)", 176 176 MS_HOLOLENS_MANUFACTURER_STRING, MS_HOLOLENS_PRODUCT_STRING, dev_holo->vendor_id, 177 177 dev_holo->product_id); 178 178 179 - if (!find_companion_device(xp, devices, device_count, ll, &hmd_type, &dev_companion, &interface_companion)) { 180 - U_LOG_IFL_E(ll, "Did not find HoloLens Sensors' companion device"); 179 + if (!find_companion_device(xp, devices, device_count, log_level, &hmd_type, &dev_companion, 180 + &interface_companion)) { 181 + U_LOG_IFL_E(log_level, "Did not find HoloLens Sensors' companion device"); 181 182 return -1; 182 183 } 183 184 184 185 struct os_hid_device *hid_holo = NULL; 185 186 result = xrt_prober_open_hid_interface(xp, dev_holo, interface_holo, &hid_holo); 186 187 if (result != 0) { 187 - U_LOG_IFL_E(ll, "Failed to open HoloLens Sensors HID interface"); 188 + U_LOG_IFL_E(log_level, "Failed to open HoloLens Sensors HID interface"); 188 189 return -1; 189 190 } 190 191 191 192 struct os_hid_device *hid_companion = NULL; 192 193 result = xrt_prober_open_hid_interface(xp, dev_companion, interface_companion, &hid_companion); 193 194 if (result != 0) { 194 - U_LOG_IFL_E(ll, "Failed to open HoloLens Sensors' companion HID interface."); 195 + U_LOG_IFL_E(log_level, "Failed to open HoloLens Sensors' companion HID interface."); 195 196 return -1; 196 197 } 197 198 198 - struct wmr_camera *cam = wmr_camera_open(dev_holo, ll); 199 + struct wmr_camera *cam = wmr_camera_open(dev_holo, log_level); 199 200 200 - struct xrt_device *p = wmr_hmd_create(hmd_type, hid_holo, hid_companion, cam, ll); 201 + struct xrt_device *p = wmr_hmd_create(hmd_type, hid_holo, hid_companion, cam, log_level); 201 202 if (!p) { 202 - U_LOG_IFL_E(ll, "Failed to create WMR HMD device."); 203 + U_LOG_IFL_E(log_level, "Failed to create WMR HMD device."); 203 204 return -1; 204 205 } 205 206 ··· 216 217 struct xrt_device **out_xdev) 217 218 { 218 219 219 - enum u_logging_level ll = debug_get_log_option_wmr_log(); 220 + enum u_logging_level log_level = debug_get_log_option_wmr_log(); 220 221 221 222 struct os_hid_device *hid_controller = NULL; 222 223 ··· 247 248 } 248 249 // else fall through 249 250 default: 250 - U_LOG_IFL_D(ll, 251 + U_LOG_IFL_D(log_level, 251 252 "Unsupported controller device (Bluetooth): vid: 0x%04X, pid: 0x%04X, Product Name: '%s'", 252 253 devices[index]->vendor_id, devices[index]->product_id, product_name); 253 254 return -1; ··· 257 258 258 259 ret = xrt_prober_open_hid_interface(xp, devices[index], interface_controller, &hid_controller); 259 260 if (ret != 0) { 260 - U_LOG_IFL_E(ll, "Failed to open WMR Bluetooth controller's HID interface"); 261 + U_LOG_IFL_E(log_level, "Failed to open WMR Bluetooth controller's HID interface"); 261 262 return -1; 262 263 } 263 264 264 265 265 - struct xrt_device *p = wmr_bt_controller_create(hid_controller, controller_type, ll); 266 + struct xrt_device *p = wmr_bt_controller_create(hid_controller, controller_type, log_level); 266 267 if (!p) { 267 - U_LOG_IFL_E(ll, "Failed to create WMR controller (Bluetooth)"); 268 + U_LOG_IFL_E(log_level, "Failed to create WMR controller (Bluetooth)"); 268 269 return -1; 269 270 } 270 271
+6 -6
src/xrt/ipc/client/ipc_client.h
··· 27 27 * 28 28 */ 29 29 30 - #define IPC_TRACE(d, ...) U_LOG_IFL_T(d->ll, __VA_ARGS__) 31 - #define IPC_DEBUG(d, ...) U_LOG_IFL_D(d->ll, __VA_ARGS__) 32 - #define IPC_INFO(d, ...) U_LOG_IFL_I(d->ll, __VA_ARGS__) 33 - #define IPC_WARN(d, ...) U_LOG_IFL_W(d->ll, __VA_ARGS__) 34 - #define IPC_ERROR(d, ...) U_LOG_IFL_E(d->ll, __VA_ARGS__) 30 + #define IPC_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__) 31 + #define IPC_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__) 32 + #define IPC_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__) 33 + #define IPC_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__) 34 + #define IPC_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__) 35 35 36 36 /* 37 37 * ··· 58 58 struct ipc_client_android *ica; 59 59 #endif // XRT_OS_ANDROID 60 60 61 - enum u_logging_level ll; 61 + enum u_logging_level log_level; 62 62 }; 63 63 64 64 /*
+4 -4
src/xrt/ipc/client/ipc_client_instance.c
··· 81 81 static bool 82 82 ipc_connect(struct ipc_connection *ipc_c) 83 83 { 84 - ipc_c->ll = debug_get_log_option_ipc_log(); 84 + ipc_c->log_level = debug_get_log_option_ipc_log(); 85 85 86 86 ipc_c->ica = ipc_client_android_create(android_globals_get_vm(), android_globals_get_activity()); 87 87 ··· 104 104 } 105 105 106 106 ipc_c->imc.socket_fd = socket; 107 - ipc_c->imc.ll = ipc_c->ll; 107 + ipc_c->imc.log_level = ipc_c->log_level; 108 108 109 109 return true; 110 110 } ··· 117 117 struct sockaddr_un addr; 118 118 int ret; 119 119 120 - ipc_c->ll = debug_get_log_option_ipc_log(); 120 + ipc_c->log_level = debug_get_log_option_ipc_log(); 121 121 122 122 // create our IPC socket 123 123 ··· 149 149 } 150 150 151 151 ipc_c->imc.socket_fd = socket; 152 - ipc_c->imc.ll = ipc_c->ll; 152 + ipc_c->imc.log_level = ipc_c->log_level; 153 153 154 154 return true; 155 155 }
+6 -6
src/xrt/ipc/server/ipc_server.h
··· 32 32 * 33 33 */ 34 34 35 - #define IPC_TRACE(d, ...) U_LOG_IFL_T(d->ll, __VA_ARGS__) 36 - #define IPC_DEBUG(d, ...) U_LOG_IFL_D(d->ll, __VA_ARGS__) 37 - #define IPC_INFO(d, ...) U_LOG_IFL_I(d->ll, __VA_ARGS__) 38 - #define IPC_WARN(d, ...) U_LOG_IFL_W(d->ll, __VA_ARGS__) 39 - #define IPC_ERROR(d, ...) U_LOG_IFL_E(d->ll, __VA_ARGS__) 35 + #define IPC_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__) 36 + #define IPC_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__) 37 + #define IPC_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__) 38 + #define IPC_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__) 39 + #define IPC_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__) 40 40 41 41 /* 42 42 * ··· 293 293 // Should we exit when a client disconnects. 294 294 bool exit_on_disconnect; 295 295 296 - enum u_logging_level ll; 296 + enum u_logging_level log_level; 297 297 298 298 struct ipc_thread threads[IPC_MAX_CLIENTS]; 299 299
+2 -2
src/xrt/ipc/server/ipc_server_process.c
··· 411 411 // Yes we should be running. 412 412 s->running = true; 413 413 s->exit_on_disconnect = debug_get_bool_option_exit_on_disconnect(); 414 - s->ll = debug_get_log_option_ipc_log(); 414 + s->log_level = debug_get_log_option_ipc_log(); 415 415 416 416 int ret = xrt_instance_create(NULL, &s->xinst); 417 417 if (ret < 0) { ··· 481 481 } 482 482 483 483 u_var_add_root(s, "IPC Server", false); 484 - u_var_add_ro_u32(s, &s->ll, "log level"); 484 + u_var_add_log_level(s, &s->log_level, "Log level"); 485 485 u_var_add_bool(s, &s->exit_on_disconnect, "exit_on_disconnect"); 486 486 u_var_add_bool(s, (void *)&s->running, "running"); 487 487
+5 -5
src/xrt/ipc/shared/ipc_utils.c
··· 31 31 * 32 32 */ 33 33 34 - #define IPC_TRACE(d, ...) U_LOG_IFL_T(d->ll, __VA_ARGS__) 35 - #define IPC_DEBUG(d, ...) U_LOG_IFL_D(d->ll, __VA_ARGS__) 36 - #define IPC_INFO(d, ...) U_LOG_IFL_I(d->ll, __VA_ARGS__) 37 - #define IPC_WARN(d, ...) U_LOG_IFL_W(d->ll, __VA_ARGS__) 38 - #define IPC_ERROR(d, ...) U_LOG_IFL_E(d->ll, __VA_ARGS__) 34 + #define IPC_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__) 35 + #define IPC_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__) 36 + #define IPC_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__) 37 + #define IPC_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__) 38 + #define IPC_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__) 39 39 40 40 void 41 41 ipc_message_channel_close(struct ipc_message_channel *imc)
+1 -1
src/xrt/ipc/shared/ipc_utils.h
··· 28 28 struct ipc_message_channel 29 29 { 30 30 int socket_fd; 31 - enum u_logging_level ll; 31 + enum u_logging_level log_level; 32 32 }; 33 33 34 34 /*!
+12 -12
src/xrt/state_trackers/oxr/oxr_vulkan.c
··· 145 145 146 146 find_to_add(enabled, enabled_count, required_vk_instance_extensions, required_count, to_add, &to_add_count); 147 147 148 - enum u_logging_level ll = debug_get_log_option_compositor_log(); 148 + enum u_logging_level log_level = debug_get_log_option_compositor_log(); 149 149 150 150 if (to_add_count == 0) { 151 - if (ll <= U_LOGGING_DEBUG) { 151 + if (log_level <= U_LOGGING_DEBUG) { 152 152 oxr_log(log, "App enabled all required instance exts"); 153 153 } 154 154 return false; ··· 159 159 160 160 for (uint32_t i = 0; i < enabled_count; i++) { 161 161 new_enabled[i] = enabled[i]; 162 - if (ll <= U_LOGGING_DEBUG) { 162 + if (log_level <= U_LOGGING_DEBUG) { 163 163 oxr_log(log, "Instance ext (app): %s", enabled[i]); 164 164 } 165 165 } 166 166 167 167 for (uint32_t i = 0; i < to_add_count; i++) { 168 168 new_enabled[enabled_count + i] = to_add[i]; 169 - if (ll <= U_LOGGING_DEBUG) { 169 + if (log_level <= U_LOGGING_DEBUG) { 170 170 oxr_log(log, "Instance ext (rt): %s", to_add[i]); 171 171 } 172 172 } ··· 190 190 191 191 find_to_add(enabled, enabled_count, required_vk_device_extensions, required_count, to_add, &to_add_count); 192 192 193 - enum u_logging_level ll = debug_get_log_option_compositor_log(); 193 + enum u_logging_level log_level = debug_get_log_option_compositor_log(); 194 194 195 195 if (to_add_count == 0) { 196 - if (ll <= U_LOGGING_DEBUG) { 196 + if (log_level <= U_LOGGING_DEBUG) { 197 197 oxr_log(log, "App enabled all required device exts"); 198 198 } 199 199 return false; ··· 204 204 205 205 for (uint32_t i = 0; i < enabled_count; i++) { 206 206 new_enabled[i] = enabled[i]; 207 - if (ll <= U_LOGGING_DEBUG) { 207 + if (log_level <= U_LOGGING_DEBUG) { 208 208 oxr_log(log, "Device ext (app): %s", enabled[i]); 209 209 } 210 210 } 211 211 212 212 for (uint32_t i = 0; i < to_add_count; i++) { 213 213 new_enabled[enabled_count + i] = to_add[i]; 214 - if (ll <= U_LOGGING_DEBUG) { 214 + if (log_level <= U_LOGGING_DEBUG) { 215 215 oxr_log(log, "Device ext (rt): %s", to_add[i]); 216 216 } 217 217 } ··· 329 329 sprintf(suggested_uuid_str + i * 3, "%02x ", sys->xsysc->info.client_vk_deviceUUID[i]); 330 330 } 331 331 332 - enum u_logging_level ll = debug_get_log_option_compositor_log(); 332 + enum u_logging_level log_level = debug_get_log_option_compositor_log(); 333 333 int gpu_index = -1; 334 334 for (uint32_t i = 0; i < count; i++) { 335 335 VkPhysicalDeviceIDProperties pdidp = {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES}; ··· 340 340 vkGetPhysicalDeviceProperties2(phys[i], &pdp2); 341 341 342 342 char uuid_str[XRT_GPU_UUID_SIZE * 3 + 1] = {0}; 343 - if (ll <= U_LOGGING_DEBUG) { 343 + if (log_level <= U_LOGGING_DEBUG) { 344 344 for (int i = 0; i < XRT_GPU_UUID_SIZE; i++) { 345 345 sprintf(uuid_str + i * 3, "%02x ", pdidp.deviceUUID[i]); 346 346 } ··· 349 349 350 350 if (memcmp(pdidp.deviceUUID, sys->xsysc->info.client_vk_deviceUUID, XRT_GPU_UUID_SIZE) == 0) { 351 351 gpu_index = i; 352 - if (ll <= U_LOGGING_DEBUG) { 352 + if (log_level <= U_LOGGING_DEBUG) { 353 353 oxr_log(log, 354 354 "Using GPU %d with uuid %s suggested " 355 355 "by runtime", ··· 371 371 sys->vulkan_enable2_instance = vkInstance; 372 372 } 373 373 sys->suggested_vulkan_physical_device = *vkPhysicalDevice; 374 - if (ll <= U_LOGGING_DEBUG) { 374 + if (log_level <= U_LOGGING_DEBUG) { 375 375 oxr_log(log, "Suggesting vulkan physical device %p", (void *)*vkPhysicalDevice); 376 376 } 377 377
+2 -2
src/xrt/state_trackers/prober/p_prober.c
··· 444 444 p->base.can_open = p_can_open; 445 445 p->base.destroy = p_destroy; 446 446 p->lists = lists; 447 - p->ll = debug_get_log_option_prober_log(); 447 + p->log_level = debug_get_log_option_prober_log(); 448 448 449 449 p->json.file_loaded = false; 450 450 p->json.root = NULL; 451 451 452 452 u_var_add_root((void *)p, "Prober", true); 453 - u_var_add_ro_u32(p, (uint32_t *)&p->ll, "Log Level"); 453 + u_var_add_log_level(p, &p->log_level, "Log level"); 454 454 455 455 int ret; 456 456
+6 -6
src/xrt/state_trackers/prober/p_prober.h
··· 36 36 * 37 37 */ 38 38 39 - #define P_TRACE(d, ...) U_LOG_IFL_T(d->ll, __VA_ARGS__) 40 - #define P_DEBUG(d, ...) U_LOG_IFL_D(d->ll, __VA_ARGS__) 41 - #define P_INFO(d, ...) U_LOG_IFL_I(d->ll, __VA_ARGS__) 42 - #define P_WARN(d, ...) U_LOG_IFL_W(d->ll, __VA_ARGS__) 43 - #define P_ERROR(d, ...) U_LOG_IFL_E(d->ll, __VA_ARGS__) 39 + #define P_TRACE(d, ...) U_LOG_IFL_T(d->log_level, __VA_ARGS__) 40 + #define P_DEBUG(d, ...) U_LOG_IFL_D(d->log_level, __VA_ARGS__) 41 + #define P_INFO(d, ...) U_LOG_IFL_I(d->log_level, __VA_ARGS__) 42 + #define P_WARN(d, ...) U_LOG_IFL_W(d->log_level, __VA_ARGS__) 43 + #define P_ERROR(d, ...) U_LOG_IFL_E(d->log_level, __VA_ARGS__) 44 44 45 45 #ifdef XRT_OS_LINUX 46 46 /*! ··· 154 154 size_t num_disabled_drivers; 155 155 char **disabled_drivers; 156 156 157 - enum u_logging_level ll; 157 + enum u_logging_level log_level; 158 158 }; 159 159 160 160