From bf75a4de61525bbc21c03027e5ab1542fefca13b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 12 Nov 2019 06:25:27 +0530 Subject: [PATCH] Also document debug() --- docs/kittens/custom.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/kittens/custom.rst b/docs/kittens/custom.rst index 19c4f79c5..7e4e1aeae 100644 --- a/docs/kittens/custom.rst +++ b/docs/kittens/custom.rst @@ -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.