xpra icon
Bug tracker and wiki

Opened 4 years ago

Closed 3 years ago

#411 closed enhancement (worksforme)

better debugging and logging tools

Reported by: Antoine Martin Owned by: Smo
Priority: major Milestone: 0.12
Component: core Version:
Keywords: Cc:


See wiki/Debugging

At the moment, we rely on:

  • environment variables
  • -d all
  • SIGUSR1 / SIGUSR2 as a big on/off switch for all debug logging

We need environment variables for 2 reasons:

  • some logging in the hot paths can be expensive - env vars allow us to turn that off completely
  • some logging happens very early on (during class loading), before we even initialize the logging properly

We want:

  • more logging granularity, so we can specify strings with "-d" apart from the catch all "all"
  • ability to turn logging on or off at runtime without restarting the server
  • better logging messages and context


  • add ability to modify the server (and maybe the client too?) via a new xpra runtime command? (maybe: "xpra debug subsystem [on|off]")
  • tune how much detail we get
  • potentially get the full calling function and frame details (as per winswitch logging utility)

Change History (5)

comment:1 Changed 3 years ago by Antoine Martin

Milestone: 0.110.12

too late for 0.11

comment:2 Changed 3 years ago by Antoine Martin

Owner: changed from Antoine Martin to Antoine Martin
Status: newassigned

comment:3 Changed 3 years ago by Antoine Martin

First step in r5379 (very large changeset - see commit message), and more in r5381, r5382, r5383

Still left TODO:

  • add "xpra control" ability to list the loggers we know about
  • benchmark it to ensure we haven't made things slower
  • look for remaining instances of environment variables used to control logging (x11 bindings probably ok - expensive)
  • automatically generate the list of categories: list categories supplied not in default list
Last edited 3 years ago by Antoine Martin (previous) (diff)

comment:4 Changed 3 years ago by Antoine Martin

Owner: changed from Antoine Martin to Smo
Status: assignednew
  • lots of little fixes and improvements: r5461, r5458, r5457, r5455, r5427, r5403, r5402, r5399, r5398, r5391, r5389, r5386, r5385
  • re-add ability (working this time) to exclude categories: r5388 (and also the same feature for X11 events debugging in r5397)
  • r5466 restores the code duplication I had removed: the default python logger class is just ridiculously slow, so we shortcut it as soon as possible

I've ran some benchmarks, it looks good after r5466, the wiki has been updated: wiki/Logging.

smo/afarr: I am assigning it to you so you are aware of the new features, feel free to close as an ACK.
It is particularly useful for debugging specific problems *after* starting the server, as one can just run:

xpra control :10 debug enable focus

And to verify:

xpra control :10 debug status

comment:5 Changed 3 years ago by Smo

Resolution: worksforme
Status: newclosed

Thanks works well.

sh-4.2$ xpra list
Found the following xpra sessions:
        LIVE session at :15
sh-4.2$ xpra control :15 debug status
logging is enabled for: []
sh-4.2$ xpra control :15 debug enable focus
logging enabled for focus
sh-4.2$ xpra control :15 debug status      
logging is enabled for: ['Logger(xpra.x11.server, server, focus)', 'Logger(xpra.x11.gtk_x11.send_wm, x11, focus)', 'Logger(xpra.x11.gtk_x11.wm, x11, window, focus)', 'Logger(xpra.x11.gtk_x11.world_window, x11, window, focus)', 'Logger(xpra.server.server_base, focus)', 'Logger(xpra.x11.gtk_x11.window, x11, window, focus)']
sh-4.2$ xpra control :15 debug disable focus
logging disabled for focus
Note: See TracTickets for help on using tickets.