Skip to content

Port almost everything to u_logging.

Lubosz Sarnecki requested to merge lubosz/monado:all-new-logging into master

This series of patches ports the complete code base to u_logging, consistently replacing printfs and deprecated logging macros.

The old logging macros did not check for valid state object in many cases. These calls needed to be adjusted to take a valid state and are now consistent.

Inconsistencies in compositor related log levels that were using old environment values were also resolved.

Improvements

  • All static logging now has a global state that can be set via XRT_LOG=debug etc.
  • I added little eye candy, having the log level strings aligned
  • Log level strings are now output in color on supported platforms (Linux).
  • Colors can be deactivated in the build by setting -DXRT_FEATURE_COLOR_LOG=0 in cmake or -Dcolor_log=false in meson.

What is left

Some drivers like V4L2, VIVE (Controller) and PSVR still use printf in debug code that concatinates strings by not printing new lines. In the case of the Vive controller it is disabled code guarded by a local define.

The oxr_logger was also left untouched as it uses custom logging and I did not bother understanding what is going on.

I leave the few leftover printfs are up to their original authors.

Available logging states with this patch set

Drivers:

ANDROID_SENSORS_LOG
ARDUINO_LOG
DAYDREAM_LOG
DUMMY_LOG
HDK_LOG
HT_LOG
HYDRA_LOG
NS_LOG
OHMD_LOG
PSMV_LOG
PSVR_LOG
SURVIVE_LOG
V4L2_LOG
VF_LOG
VIVE_LOG

Other:

AHARDWAREBUFFER_LOG
EGL_LOG
EGL_SWAPCHAIN_LOG
IPC_LOG
PROBER_LOG
PSVR_TRACKING_LOG
SIMPLE_IMU_LOG
XRT_COMPOSITOR_LOG
XRT_LOG

Merge request reports