Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve handler filters if present (allows Filter(s) to work with coloredlogs) #89

Merged
merged 3 commits into from Dec 10, 2020

Conversation

eblis
Copy link

@eblis eblis commented Apr 23, 2020

A fix for issue #32 which I've recently encountered myself.
I was able to trace the problem to the way the handlers are replaced, that's when any existing filters get discarded.

The fix is to preserve the existing filters and apply them back once the new handler has been created

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 91.586% when pulling 95e6c76 on eblis:master into 3935774 on xolox:master.

xolox added a commit that referenced this pull request Dec 10, 2020
@xolox xolox merged commit 6dd730d into xolox:master Dec 10, 2020
@xolox
Copy link
Owner

xolox commented Dec 10, 2020

Hi @eblis and thanks for the pull request. I've just published coloredlogs release 14.3 which incorporates these changes. Cheers!

bors bot added a commit to duckinator/bork that referenced this pull request Dec 10, 2020
220: Update coloredlogs to 15.0 r=duckinator a=pyup-bot


This PR updates [coloredlogs](https://pypi.org/project/coloredlogs) from **14.0** to **15.0**.



<details>
  <summary>Changelog</summary>
  
  
   ### 15.0
   ```
   ----------------------------

Don&#39;t enable system logging on MacOS and Windows anymore.

This is backwards incompatible (which is why I&#39;m bumping the major version
number) however the old behavior has been reported to be rather problematic
(see :func:`~coloredlogs.syslog.is_syslog_supported()` for details) so this
seems like the best choice.

.. _Release 15.0: xolox/python-coloredlogs@14.2...15.0
   ```
   
  
  
   ### 14.3
   ```
   ----------------------------

Merged pull request `89`_ which enhances :func:`coloredlogs.install()` to
preserve the filters on handlers that are replaced by :pypi:`coloredlogs`.

.. _Release 14.3: xolox/python-coloredlogs@14.2...14.3
.. _89: xolox/python-coloredlogs#89
   ```
   
  
  
   ### 14.2
   ```
   ----------------------------

Honor the ``$NO_COLOR`` environment variable as suggested in issue `88`_.

.. _Release 14.2: xolox/python-coloredlogs@14.1...14.2
.. _88: xolox/python-coloredlogs#88
   ```
   
  
  
   ### 14.1
   ```
   ----------------------------

**Bug fixes:**

- Don&#39;t allow interactive terminal detection to disable colored text when
  colored text is being forced by the caller (reported in issue `84`_).

- Automatically disable colored text when logging output is being redirected to
  a file in such a way that it actually works 😬 (reported in issue `100`_).

**Other changes:**

- Start testing on PyPy 3 (because why not?)

.. _Release 14.1: xolox/python-coloredlogs@14.0...14.1
.. _84: xolox/python-coloredlogs#84
.. _100: xolox/python-coloredlogs#100
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/coloredlogs
  - Changelog: https://pyup.io/changelogs/coloredlogs/
  - Docs: https://coloredlogs.readthedocs.io
</details>



Co-authored-by: pyup-bot <github-bot@pyup.io>
Co-authored-by: Ellen Marie Dash <me@duckie.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants