Also document debug()

This commit is contained in:
Kovid Goyal 2019-11-12 06:25:27 +05:30
parent 400ab584ac
commit bf75a4de61
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -135,7 +135,15 @@ Debugging kittens
--------------------
The part of the kitten that runs in ``main()`` is just a normal programs and
the output of print statements will be visible in the kitten window.
the output of print statements will be visible in the kitten window. Or
alternately, you can use::
from kittens.tui.loop import debug
debug('whatever')
The ``debug()`` function is just like ``print()`` except that the output
will appear in the stdout of the kitty process inside which the kitten is
running.
The ``handle_result()`` part of the kitten runs inside the kitty process.
The output of print statements will go to the ``STDOUT`` of the kitty process.