Content-Length: 283563 | pFad | https://github.com/python/cpython/issues/132106

36 Allow logging.handlers.QueueListener to be used as a context manager · Issue #132106 · python/cpython · GitHub
Skip to content

Allow logging.handlers.QueueListener to be used as a context manager #132106

@csm10495

Description

@csm10495

Feature or enhancement

Proposal:

This is a simple change that would allow:

         with QueueListener(queue, handler1) as listener:
             # the listener has started
             ...
         # the listener has stopped

It's a welcomed alternative to needing to call start/stop manually.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/allow-logging-handlers-queuelistener-to-be-used-as-a-context-manager/87124

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/132106

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy