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

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

Build:
Build:
LAST BUILD BRANCH: dev
DEFAULT BRANCH: master
Ran 13 May 2018 08:50PM UTC
Jobs 6
Files 6
Run time 1min
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

pending completion
193

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)

566 of 602 relevant lines covered (94.02%)

5.52 hits per line

Jobs
ID Job ID Ran Files Coverage
2 193.2 13 May 2018 08:50PM UTC 0
91.69
Travis Job 193.2
3 193.3 13 May 2018 08:50PM UTC 0
91.86
Travis Job 193.3
4 193.4 13 May 2018 08:50PM UTC 0
91.86
Travis Job 193.4
5 193.5 13 May 2018 08:50PM UTC 0
91.69
Travis Job 193.5
6 193.6 13 May 2018 08:51PM UTC 0
91.86
Travis Job 193.6
7 193.7 13 May 2018 08:51PM UTC 0
93.36
Travis Job 193.7
Source Files on build 193
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #193
  • 9082a121 on github
  • Prev Build on dev (#191)
  • Next Build on dev (#194)
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