From 6c9c93be7e9aabf7533489448bda1b70fb0e41bc Mon Sep 17 00:00:00 2001 From: Miro <200482516+Mirochill@users.noreply.github.com> Date: Mon, 25 May 2026 21:14:59 +0200 Subject: [PATCH] Document hpack logger configuration Signed-off-by: Miro <200482516+Mirochill@users.noreply.github.com> --- docs/source/index.rst | 1 + docs/source/logging.rst | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 docs/source/logging.rst diff --git a/docs/source/index.rst b/docs/source/index.rst index 0da0234..6d29add 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -33,6 +33,7 @@ Contents installation api + logging security/index diff --git a/docs/source/logging.rst b/docs/source/logging.rst new file mode 100644 index 0000000..432b3f6 --- /dev/null +++ b/docs/source/logging.rst @@ -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)