Skip to content

Commit

Permalink
docs: add logging section to user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
rossengeorgiev committed Aug 21, 2021
1 parent b2e1f77 commit 66f1ee9
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,38 @@ Alternatively, a callback can be registered to handle the response event every t
client.on(EMsg.ClientAddFriendResponse, handle_add_response)
Loggging
========

It is often useful to see the message that are coming in and going on.
Here is how to enable debug logging to the console.

.. code:: python
import logging
logging.basicConfig(format='[%(asctime)s] %(levelname)s %(name)s: %(message)s', level=logging.DEBUG)
For more complicated :mod:`logging` configurations, consult the python documentation.

By default the :class:`.SteamClient` will not log the contents of messages.
To enable that simply set :attr:`.SteamClient.verbose_debug` to ``True`` on your :class:`.SteamClient` instance.

.. code:: python
client = SteamClient()
client.verbose_debug = True
When there are multiple instances, they will all log under the same logger name.
We can override the default logger instances with new one and give it a different name.

.. code:: python
client1 = SteamClient()
client2 = SteamClient()
client1._LOG = logging.getLogger("SC#1")
client2._LOG = logging.getLogger("SC#2")
Web Authentication
==================

Expand Down

0 comments on commit 66f1ee9

Please sign in to comment.