Mercurial > libervia-backend
comparison doc/jp/debug.rst @ 3041:72583524cfd3
doc (jp): jp commands are now fully documented:
rel 232
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 01 Oct 2019 22:49:06 +0200 |
parents | |
children | cf843dd7c345 |
comparison
equal
deleted
inserted
replaced
3040:fee60f17ebac | 3041:72583524cfd3 |
---|---|
1 ===================================================== | |
2 debug: tools to help debugging/monitoring Salut à Toi | |
3 ===================================================== | |
4 | |
5 ``debug`` groups commands to monitor or manipulate SàT and XMPP stream. | |
6 | |
7 .. _jp-debug_bridge_method: | |
8 | |
9 bridge method | |
10 ============= | |
11 | |
12 Call a method of the bridge. You have to provide the name of the method and the arguments | |
13 as positional arguments. Arguments are evaluated as Python code (using ``eval``), so you | |
14 need to properly escape them (for your shell **and** Python). You can either split your | |
15 Python arguments as many shell arguments, or put them in a single shell argument. | |
16 | |
17 You profile is automatically set if the method requires it (using the value of ``-p | |
18 PROFILE, --profile PROFILE``), so you must not specify it as an extra argument. | |
19 | |
20 You can refer to `Bridge API documentation`_ to get core methods signatures | |
21 | |
22 .. _Bridge API documentation: https://wiki.goffi.org/wiki/Bridge_API | |
23 | |
24 | |
25 examples | |
26 -------- | |
27 | |
28 Send a message using a single shell arguments for all Python arguments. We | |
29 use first the method name (``messageSend``), then the required arguments (see `Bridge | |
30 API documentation`_ for details), without the profile as it is automatically set. We | |
31 specify them as Python in one shell argument, so we use single quote (``\```)first for | |
32 s hell string, and inside it we use double quote (``"``) for Python strings:: | |
33 | |
34 $ jp debug bridge method messageSend '"louise@example.org", {"": "test message"}, {}, "auto", {}' | |
35 | |
36 .. note:: | |
37 | |
38 This is for debugging only, if you want to send message with jp, use :ref:`jp-message_send`. | |
39 | |
40 Get version string of SàT:: | |
41 | |
42 $ jp debug bridge method getVersion | |
43 | |
44 | |
45 bridge signal | |
46 ============= | |
47 | |
48 Send a fake signal. This is specially useful to test behaviour of a frontend when a | |
49 specific event happens. To use is you just need to specify the name of the signal and the | |
50 arguments to use (using Python eval in the same way as for jp-debug_bridge_method_). | |
51 | |
52 example | |
53 ------- | |
54 | |
55 Send a note with ``info`` level and hand written XMLUI. Here me use a shell variable to | |
56 store the level, so we can easily change it if we want to use an other level for tests. | |
57 Note the use of quotes (to escape both for shell and Python):: | |
58 | |
59 $ LEVEL='info'; jp debug bridge signal -c actionNew '{"xmlui": '"'"'<?xml version="1.0" ?><sat_xmlui title="test title" type="dialog"><dialog level="'$LEVEL'" type="note"><message>test message\non\nseveral\nlines</message></dialog></sat_xmlui>'"'"'}' '""' -1 | |
60 | |
61 | |
62 monitor | |
63 ======= | |
64 | |
65 Show raw XML stream. By default, output is pretty formatted/highlighted and you get all | |
66 streams in both direction. You can filter the direction using ``-d {in,out,both}, | |
67 --direction {in,out,both}``. | |
68 | |
69 For this to work, you need to set the option ``Activate XML log`` in the ``Debug`` section | |
70 of your parameters. | |
71 | |
72 Verbosity is used, to print details on the direction of a stanza, use ``--verbose, -v`` | |
73 | |
74 example | |
75 ------- | |
76 | |
77 Monitor raw XML stream:: | |
78 | |
79 $ jp debug monitor -v |