Skip to main content

birling

birling measures log coverage in Python projects: how well the code is covered by log calls, the way coverage.py measures how well it is covered by tests. It recognises the standard logging module, structlog and loguru, and a project's own logging helpers.

A handled exception that leaves no log is a failure nobody hears about. birling finds the places in the code where something should be logged, checks whether a log call is there, and gives the project a score that a CI run can hold to a minimum. By default, those places are except handlers that do not raise again.

$ birling shop
Name              Branches  Logged  Score  Unlogged
---------------------------------------------------
shop/orders.py           2       1    50%  12
shop/payments.py         2       1    50%  12
---------------------------------------------------
TOTAL                    4       2    50%

Installation

birling needs Python 3.11 or later and has no dependencies of its own. Install it from PyPI:

pip install birling

The coverage extra, birling[coverage], adds coverage.py, which the command needs to mark the unlogged branches that ran in the tests and to find the logged branches where no log call ran.

Usage

birling PATH... [--config FILE] [--fail-under SCORE] [--coverage-file FILE] [--show-unlogged] [--show-unrun-logs]

The command reads its configuration from the [tool.birling] table of pyproject.toml, and exits with status 1 when the score is below the minimum:

[tool.birling]
fail-under = 80

The standard logging module needs no configuration; other logging libraries and a project's own logging helpers are described in the table.

--show-unlogged lists each unlogged branch as path:line, and a # noqa: BRL001 comment on its except line accepts a branch that rightly does not log.

Documentation

The documentation is at birling.readthedocs.io: the command, the configuration, how branches and log calls are found, and the Python interface.

The name

Log rolling, sometimes called birling, is a sparring sport involving two competitors, each standing on one end of a free-floating log in a body of water. The two battle to dislodge each other from the log while keeping their own footing on it by spinning and kicking it and various other means.

— Wikipedia, Logrolling (sport)

The lumberjacks' sport lends its name to a tool for keeping on top of a project's logs.

Status

birling is in alpha: its interface may change from one release to the next.

Metadata

Release files for birling 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for birling 0.2.0
File Size Uploaded Provenance Actions
birling-0.2.0.tar.gz 130.0 kB Without provenance Details for birling-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for birling 0.2.0
File Interpreter ABI Platform Actions
birling-0.2.0-py3-none-any.whl Python 3 none any Details for birling-0.2.0-py3-none-any.whl

Total release size: 156.2 kB

Release files / birling-0.2.0.tar.gz

Download URL birling-0.2.0.tar.gz
Size 130.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7bac01c8137327be0bf828e0c1e77394559de65571af7b4c77172d0c1aacc9f1
BLAKE2b-256 checksum
How to use checksums
0542175718fc7b32f79fa66a768da9cda4b2c9cb1ecbc8a6943b0a3aaab2f502
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / birling-0.2.0-py3-none-any.whl

Download URL birling-0.2.0-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9d2620739cdae74810b669490cb879371913250e3dfacd4ac300145c215d33f
BLAKE2b-256 checksum
How to use checksums
85ce68fe48111b467102a1a5255a43d61a82648915df1c161dd6ce724ad774a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for birling 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page