[SàT dev] [en] debugging tools

Goffi goffi at goffi.org
Dim 21 Aou 15:31:31 CEST 2016


Hi there,

just a quick note to tell you that there a new debugging commands in jp, 
namely "jp debug".

For now there is only a bridge subcommand, with 2 sub-subcommands: method and 
signal.

As you can guess, the first one allow to call a bridge method pretty much as 
you could do with D-Bus, but directly from jp (which should make it easier).

Commands are passed as Python expression (they are transformed to Python using 
"eval", so you can use real Python code), which of course you need to escape 
in shell syntax. Here are 2 examples:

- getting the current version using getVersion bridge method:

% jp debug bridge method getVersion
0.7.0D (rev 3a5badbb443d (default 2016-08-21 12:27 +0200))

- getting the available menus:

% jp debug bridge method getMenus '""' -1
[D-Bus array]

note here that I use "" for an empty Python string that I have to escape for 
shell (I use here single quotes), resulting in '""' (i.e. double-quoted empty 
python string escaped in single quoted shell string).

The profile is passed using the common --profile optional argument, in the 
previous examples default profile has been used.

The other method, "signal", allow to send a signal from backend, using the new 
debug plugin. This allow to simulate events without having to repeat same 
operations each time. For instance, I've used it to test Cagou notifications.
It's used in the same way as method.

I'm planing to implement a monitor command, with pretty printed XML for XMPP 
logs and/or bridge monitoring, and an other one to send raw XML with nice 
syntax. If you have other ideas, feel free to propose (or implement) them.

As usual, feedback welcome.

Goffi



Plus d'informations sur la liste de diffusion dev