Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Contents

installation
api
logging
security/index


Expand Down
29 changes: 29 additions & 0 deletions docs/source/logging.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Logging configuration
=====================

``hpack`` uses Python's standard :mod:`logging` package and creates named
loggers for its modules. The most verbose encoder, decoder, and header table
diagnostics are emitted by the ``hpack.hpack`` and ``hpack.table`` loggers at
``DEBUG`` level.

If your application enables ``DEBUG`` logging globally but does not need these
low-level HPACK diagnostics, configure the ``hpack`` logger separately:

.. code-block:: python

import logging

logging.basicConfig(level=logging.DEBUG)
logging.getLogger("hpack").setLevel(logging.WARNING)

This leaves ``DEBUG`` logging enabled for your application while suppressing
debug records from ``hpack`` and its child loggers.

You can also configure the individual modules if you need finer control:

.. code-block:: python

import logging

logging.getLogger("hpack.hpack").setLevel(logging.WARNING)
logging.getLogger("hpack.table").setLevel(logging.WARNING)