Re: How to trace Leo Core?

2019-10-01 Thread Viktor Ransmayr
Hello Edward,

Am Mo., 30. Sept. 2019 um 23:04 Uhr schrieb Edward K. Ream <
edream...@gmail.com>:

> On Sun, Sep 29, 2019 at 2:43 PM Viktor Ransmayr 
> wrote:
>
>>
>> I tried to find out, if I can enable 'auditing/ tracing' for Leo in order
>> to 'visualize' the run-time behavior of Leo Core ...
>>
>
> The various --trace options are good if they tell you what you want to see.
>
> Usually, I put g.trace statements into Leo's source code.  A cff shows
> there are 414 nodes in Leo's code with such statements, so you shouldn't
> have too much trouble finding examples :-)
>

It looks like I was under the false impression, that Leo's code does have a
'verbose/ non-verbose' tracing mode available as well. - I had hoped, that
if I use the 'verbose' tracing mode, Leo's modules would automatically
leave their traces in the log ...

With kind regards,

Viktor

-- 
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/CAAeSrG%2B80jNg7B0ES%2BJUfUafR_tcrvq2A2Bc9WmyHoGvscb40g%40mail.gmail.com.


Re: How to trace Leo Core?

2019-09-30 Thread Edward K. Ream
On Sun, Sep 29, 2019 at 3:59 PM Brian Theado  wrote:

> 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.
>

Thanks for this link.  I've bookmarked it.

Edward

-- 
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/CAMF8tS2tQWwJWXytvXOqoyb4_Hum%2Bwv9CU8%2B8d3-Fu5Ofmqw1g%40mail.gmail.com.


Re: How to trace Leo Core?

2019-09-30 Thread Edward K. Ream
On Sun, Sep 29, 2019 at 2:43 PM Viktor Ransmayr 
wrote:

>
> I tried to find out, if I can enable 'auditing/ tracing' for Leo in order
> to 'visualize' the run-time behavior of Leo Core ...
>

The various --trace options are good if they tell you what you want to see.

Usually, I put g.trace statements into Leo's source code.  A cff shows
there are 414 nodes in Leo's code with such statements, so you shouldn't
have too much trouble finding examples :-)

Edward

-- 
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/CAMF8tS04WpTkhNO6B3G1CCJ%3DVvdqFcsjyzATD3V%2Bz1XGRiKXFw%40mail.gmail.com.


Re: How to trace Leo Core?

2019-09-30 Thread Viktor Ransmayr
Hello Brian,

Am So., 29. Sept. 2019 um 22:59 Uhr schrieb Brian Theado <
brian.the...@gmail.com>:

> 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.
>
> ...
>
> Not sure this is really what you are after, but I thought I'd share in
> case in helps.
>

It's not exactly what I'm after, but your description - as well as - the
README of python-hunter makes it clear, that this is an option I'll
investigate further.

Thanks a lot for sharing!

With kind regards,

Viktor

-- 
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/CAAeSrG%2B7i7z8tg_X%3DCZJDRxrZ%3DCF65VvDDMk_QZFgK4q4%2B0VYA%40mail.gmail.com.


Re: How to trace Leo Core?

2019-09-29 Thread Brian Theado
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 
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
>
> ---
>
> 
>
> 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
>
> 
>
> --
> 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
> 
> .
>

-- 
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.


How to trace Leo Core?

2019-09-29 Thread Viktor Ransmayr
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

---



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



-- 
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.