Skip to content

Commit ae853f2

Browse files
committed
Add Debugging guide
1 parent feaa4fc commit ae853f2

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

docs/getting-started/debugging.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.. _debugging:
2+
3+
.. currentmodule:: twitchio
4+
5+
Debugging
6+
#########
7+
8+
Most issues can be resolved by checking the :ref:`faqs` or by asking in our `Discord <https://discord.gg/RAKc3HF>`_.
9+
10+
If you believe you have found a bug or issue with the library please make an issue on `GitHub <https://github.com/PythonistaGuild/TwitchIO/issues>`_.
11+
12+
13+
Logging
14+
--------
15+
16+
To make it easier for us to debug your issue, we will often ask for DEBUG level logging. You can easily setup logging with the
17+
:func:`~twitchio.utils.setup_logging` function.
18+
19+
.. code:: python3
20+
21+
import logging
22+
import twitchio
23+
24+
handler = logging.FileHandler(filename='twitchio.log', encoding='utf-8', mode='w')
25+
twitchio.utils.setup_logging(level=logging.DEBUG, handler=handler)
26+
27+
28+
You should only need to call this function once, before the bot is started.
29+
30+
Capture and include logs leading upto and shortly after the issue. Please note this file can get very large very quickly and you
31+
may need to setup a rotating logger or monitor its size.
32+
33+
34+
Version/System Information
35+
--------------------------
36+
37+
We will also often ask for your system information and versions of various libs. To make this easier you can run the following
38+
command in the environment TwitchIO is currently installed.
39+
40+
**Windows:**
41+
42+
``py -m twitchio --version``
43+
44+
45+
**Linux:**
46+
47+
``python -m twitchio --version``
48+
49+
Please make sure to copy the whole output of this command as it is all useful.
50+
51+
52+
Minimum Reproducible Example
53+
----------------------------
54+
55+
Please have ready and include a minimal example of how to reproduce your issue, including any required steps needed when asking for help.
56+
This allows us to help more effeciently.

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Getting Started
5555
:caption: Getting Started
5656

5757
getting-started/installing
58+
getting-started/debugging
5859
getting-started/migrating
5960
getting-started/quickstart
6061
getting-started/changelog

0 commit comments

Comments
 (0)