Skip to content

Commit

Permalink
Give queue worker thread a name (Delgan#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-mart authored and Delgan committed Nov 24, 2019
1 parent 44fe934 commit a5fc907
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- Add the level ``name`` as the first argument of namedtuple returned by the ``.level()`` method.
- Raise ``TypeError`` instead of ``ValueError`` when a ``logger`` method is called with argument of invalid type.
- Remove inheritance of some record dict attributes to ``str`` (for ``"level"``, ``"file"``, ``"thread"`` and ``"process"``).

- Give queue worker thread a name.

`0.3.2`_ (2019-07-21)
=====================
Expand Down
6 changes: 5 additions & 1 deletion loguru/_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ def __init__(
if self._enqueue:
self._owner_process = multiprocessing.current_process()
self._queue = multiprocessing.SimpleQueue()
self._thread = threading.Thread(target=self._queued_writer, daemon=True)
self._thread = threading.Thread(
target=self._queued_writer,
daemon=True,
name="loguru-writer-%d" % self._id
)
self._thread.start()

def __repr__(self):
Expand Down

0 comments on commit a5fc907

Please sign in to comment.