Skip to content

Commit 7fe1771

Browse files
Clarify logging behavior (#421)
* Clarify logging behavior * minor adjustments --------- Co-authored-by: Miguel Grinberg <[email protected]>
1 parent acbbcba commit 7fe1771

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

docs/client.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,13 @@ terminal::
199199
# asyncio
200200
eio = engineio.AsyncClient(logger=True)
201201

202-
The ``logger`` argument can be set to ``True`` to output logs to ``stderr``, or
203-
to an object compatible with Python's ``logging`` package where the logs should
204-
be emitted to. A value of ``False`` disables logging.
202+
The ``logger`` argument controls logging behavior:
203+
204+
* ``True``: Enables log output to ``stderr`` at the ``INFO`` level.
205+
* ``False``: Enables log output to ``stderr`` at the ``ERROR`` level. This is
206+
the default.
207+
* A ``logging.Logger`` instance: Uses the provided logger without additional
208+
configuration.
205209

206210
Logging can help identify the cause of connection problems, unexpected
207211
disconnections and other issues.

docs/server.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,13 @@ terminal::
350350
# asyncio
351351
eio = engineio.AsyncServer(logger=True)
352352

353-
The ``logger`` argument can be set to ``True`` to output logs to ``stderr``, or
354-
to an object compatible with Python's ``logging`` package where the logs should
355-
be emitted to. A value of ``False`` disables logging.
353+
The ``logger`` argument controls logging behavior:
354+
355+
* ``True``: Enables log output to ``stderr`` at the ``INFO`` level.
356+
* ``False``: Enables log output to ``stderr`` at the ``ERROR`` level. This is
357+
the default.
358+
* A ``logging.Logger`` instance: Uses the provided logger without additional
359+
configuration.
356360

357361
Logging can help identify the cause of connection problems, 400 responses,
358362
bad performance and other issues.

0 commit comments

Comments
 (0)