Edward can speak to the built-in leo traces, but there are also other
options.

I mentioned in the thread at
https://groups.google.com/forum/#!topic/leo-editor/r6ktpQNWySk, about using
the python trace module for debugging python applications, but I no longer
recommend using it because it is too difficult to filter out noise. Since
then I've discovered https://github.com/ionelmc/python-hunter and it is
excellent. You can filter exactly which modules do and don't get traced and
the colorized output looks nice.

Depending on what pattern of modules you pick to trace you will still get a
firehose of information. You can either fine-tune your python-hunter
queries more or just save the trace output to a file which you can search
through.

But sometimes the approach Edward advocates in the above thread of
modifying the code yourself and adding traces and using clones will be
better. It's wise to heed his caution about signal to noise ratio :-).

Here is an example python hunter trace I've run on leo (after pip install
hunter):

PYTHONHUNTER="module='leo.core.leoApp'" HOME=$HOME/tmp/blank
../pyqt-3.7-venv/bin/python launchLeo.py ~/tmp/new.leo


Here are some more example trace queries I've used:

PYTHONHUNTER="module_in=['leo.core.leoApp', 'leo.core.leoNodes']"
PYTHONHUNTER="~Q(kind='line'),module_in=['leo.core.leoApp',
'leo.core.leoNodes']"
PYTHONHUNTER="Q(module_startswith='leo')"


Here, I redirect to the pager program 'less' and do it in such a way as to
not lose the color. By using less, I can search through the results
(leo-bridge-test.py is just a file I was using to learn about leo bridge).

PYTHONHUNTER="Q(module_startswith='leo'),action=CallPrinter(force_colors=True)"
HOME=$HOME/tmp/blank ../pyqt-3.7-venv/bin/python  leo-bridge-test.py 2>&1 |
less -R


Not sure this is really what you are after, but I thought I'd share in case
in helps.

Brian


On Sun, Sep 29, 2019 at 3:43 PM Viktor Ransmayr <viktor.ransm...@gmail.com>
wrote:

> Hello Edward,
>
> I tried to find out, if I can enable 'auditing/ tracing' for Leo in order
> to 'visualize' the run-time behavior of Leo Core ...
>
> I started with something, that I thought should/ would be an easy starting
> point: I tried to audit/ trace what happens, when Leo opens an empty
> outline in a PyVE using:
>
> * (Leo) PS C:\Users\Viktor\PyVE\PyPI\Leo\Lib\site-packages\leo\core>
> ./runLeo.py --trace=plugins ~/empty.leo
>
> The result (Log-001) was not that helpfull. - Am I missing something?
>
> With kind regards,
>
> Viktor
>
> ---
>
> <Start-Log-001>
>
> Leo Log Window
> Leo 6.0-final
> Python 3.7.4, PyQt version 5.13.0
> Windows 10 AMD64 (build 10.0.18362) SP0
> current dir: C:/Users/Viktor/PyVE/PyPI/Leo/Lib/site-packages/leo/core
> load dir: C:/Users/Viktor/PyVE/PyPI/Leo/lib/site-packages/leo/core
> global config dir:
> C:/Users/Viktor/PyVE/PyPI/Leo/lib/site-packages/leo/config
> home dir: C:/Users/Viktor
> reading settings in
> C:/Users/Viktor/PyVE/PyPI/Leo/lib/site-packages/leo/config/leoSettings.leo
> reading settings in C:/Users/Viktor/.leo/myLeoSettings.leo
> loadOnePlugin: loaded: leo.plugins.plugins_menu
> loadOnePlugin: loaded: leo.plugins.mod_scripting
> loadOnePlugin: loaded: leo.plugins.viewrendered
>
> <End-Log-001>
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leo-editor+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/leo-editor/c89b189a-5aec-48d8-b312-65cba932a850%40googlegroups.com
> <https://groups.google.com/d/msgid/leo-editor/c89b189a-5aec-48d8-b312-65cba932a850%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAO5X8Cwg065h3NW1_XLs10ALJMaAzmm9Wf%3DJyqOchfON9Cd5Ng%40mail.gmail.com.

Reply via email to