• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xolox / python-coloredlogs / 193 / 4
91%
master: 91%

Build:
Build:
LAST BUILD BRANCH: dev
DEFAULT BRANCH: master
Ran 13 May 2018 08:50PM UTC
Files 6
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 May 2018 08:47PM UTC coverage: 91.86% (-0.4%) from 92.25%
193.4

push

travis-ci

xolox
Proper format string parsing, support for style='{' (#11, #17, #52)

Until now coloredlogs has required differently colored 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 ar... (continued)

553 of 602 relevant lines covered (91.86%)

0.92 hits per line

Source Files on job 193.4
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 187
  • Travis Job 193.4
  • 9082a121 on github
  • Prev Job for on dev (#191.6)
  • Next Job for on dev (#194.6)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc