Colouredlogs

Latest version: v10.0.1

Safety actively analyzes 621825 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 10

10.0.1

------------------------------

- Change all "color" references to "colour".
- A bug with UTC timezones was fixed in the tests.

.. _Release 10.0.1: https://github.com/kyle-verhoog/python-colouredlogs/compare/10.0...10.0.1

10.0

----------------------------

Proper format string parsing, support for ``style='{'`` (`11`_, `17`_, `52`_).

Until now colouredlogs has required differently coloured fields in logging format
strings to be delimited by whitespace, leading to various issues:

- Back in December 2015 issue `11`_ was reported by someone who had expected
to be able to style fields without whitespace in between differently.

- Until `52`_ was merged (released as 9.2 in April 2018) any whitespace would
be collapsed to a single space, simply as a side effect of splitting on
whitespace.

- This implementation was so naive that it didn't support whitespace as a
padding character in ``%()`` formatting directives, because it wasn't able to
distinguish formatting directives from surrounding text.

In order to properly fix `11`_ I'm now introducing a very different approach
that does distinguish formatting directives from their surrounding text, which
means whitespace is no longer required. However in order to reduce the
conceptual incompatibilities between the old versus new approach whitespace is
still significant, as follows:

1. First the logging format string is separated into formatting directives
versus surrounding text (which means whitespace used as a padding character
in a ``%()`` formatting directive is considered to be part of the formatting
directive, as it should).

2. Then formatting directives and surrounding text are grouped based on
whitespace delimiters (in the surrounding text).

3. For each group styling is selected as follows:

1. If the group contains a single formatting directive that has a style
defined then the whole group is styled accordingly. This is the behavior
which provides (some level of) conceptual backwards compatibility.

2. If the group contains multiple formatting directives that have styles
defined then each formatting directive is styled individually and
surrounding text isn't styled (this behavior is backwards incompatible
but arguably an improvement over the old behavior).

While I was working on the improved format string parsing I figured it was
easiest to include support for ``style='{'`` (requested in `17`_) from the
start in the new implementation, given that I was redoing the affected code
anyway.

.. _Release 10.0: https://github.com/xolox/python-coloredlogs/compare/9.3.1...10.0
.. _11: https://github.com/xolox/python-coloredlogs/issues/11
.. _17: https://github.com/xolox/python-coloredlogs/issues/17

9.3.1

-----------------------------

Bug fix: Restore MacOS compatibility after publishing release 9.3.

The following build failure became apparent to me just minutes after
publishing release 9.3 so I decided to change the implementation:
https://travis-ci.org/xolox/python-coloredlogs/jobs/372806733

.. _Release 9.3.1: https://github.com/xolox/python-coloredlogs/compare/9.3...9.3.1

9.3

---------------------------

Enable flexible millisecond formatting using the ``%f`` directive (`45`_).

.. _Release 9.3: https://github.com/xolox/python-coloredlogs/compare/9.2...9.3
.. _45: https://github.com/xolox/python-coloredlogs/issues/45

9.2

---------------------------

- Merged pull request `47`_: Switch to ``logging.getLogRecordFactory()``. In
the merge commit I added a small performance enhancement by checking for the
existence of ``logging.getLogRecordFactory()`` just once, when a
``ColouredFormatter`` object is instantiated.

- Merged pull request `52`_: Don't change whitespace in format strings. In the
merge commit I promoted the inline function to an instance method so that it
can be reused by sub classes of ``ColouredFormatter``.

.. _Release 9.2: https://github.com/xolox/python-coloredlogs/compare/9.1...9.2
.. _47: https://github.com/xolox/python-coloredlogs/pull/47
.. _52: https://github.com/xolox/python-coloredlogs/pull/52

9.1

---------------------------

- Added ``license`` key to ``setup.py`` script (`53`_).
- Added this changelog (requested in `55`_).

.. _Release 9.1: https://github.com/xolox/python-coloredlogs/compare/9.0...9.1
.. _53: https://github.com/xolox/python-coloredlogs/pull/53
.. _55: https://github.com/xolox/python-coloredlogs/issues/55

Page 1 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.