Skip to content

src: Add feature of printing PID, ClientName and Timestamp

zhenyan huang requested to merge hzy/wayland:main into main

This commit add two features into WAYLAND_DEBUG logging:

  • Add PID, ClientName to WAYLAND_DEBUG logging, which is pretty usefull to distinguish which client send which message, especially in debugging. I only printed the client name while avoiding introducing too much information for printing.
  • Add human-readable timestamp format is usefull when log files loged wayland protocol messages and apps messages separately.

E.g.:

  • To use PID&ClientName logging: e.g.: export WAYLAND_DEBUG=server:pid
  • To use timestamp logging: call wl_set_time_format(),
    • WL_TIME_FORMAT_LOCAL (default)
    • WL_TIME_FORMAT_EPOCH (original)

The log like this:

[2024-10-16 09:12:06] [PID:7085(dde-desktop)] wl_display@1.sync(new id wl_callback@3)
[2024-10-16 09:12:06]  -> wl_callback@3.done(0)
Edited by zhenyan huang

Merge request reports

Loading