Skip to main content

Bug Trail

This is a workstation logger to capture bugs encountered while you are writing code.

In other words, it is an HTML report writer for your logs, even if they aren't errors if that is your thing.

Installation

Install this with your app. It has as few dependencies as I could manage.

pip install bug-trail-core

To generate the static website install this in an isolated global virtual environment.

pipx install bug-trail

Usage

Configuration is optional via a pyproject.toml file and the logging modules ordinary configuration options. See example code-as-config

This is the schema with the default values.

[tool.bug-trail]
app_name = "bug_trail"
app_author = "bug_trail"
report_folder = "logs"
database_path = "bug_trail.db"
import bug_trail
import logging

section = bug_trail.read_config(config_path="../pyproject.toml")
handler = bug_trail.BugTrailHandler(section.database_path, minimum_level=logging.ERROR)
logging.basicConfig(handlers=[handler], level=logging.ERROR)

logger = logging.getLogger(__name__)
logger.error("This is an error message")

To generate to the log folder relative to the current working directory:

bug_trail --output logs --db error_log.db

Picologging

If you want to use picologging, install it. Everything is the same except you use the PicoBugTrailHandler.

import bug_trail
import logging

section = bug_trail.read_config(config_path="../pyproject.toml")
handler = bug_trail.PicoBugTrailHandler(
    section.database_path, minimum_level=logging.ERROR
)
logging.basicConfig(handlers=[handler], level=logging.ERROR)

logger = logging.getLogger(__name__)
logger.error("This is an error message")

Do more with your data

pipx install datasette
datasette bug_trail.db

Security

None. Do not publish your error log to the internet or to public Github. Add the log folder to your .gitignore file.

Advanced

Get ctags from here

./ctags -R -f fish_tank.tags fish_tank

Prior Art

Inspired by elmah. bug_trail is much less ambitious, as this is just a browsable, static HTML report.

If you want logger for a website, hosted in your Flask or Django website:

These are the closest "write logs to HTML" projects I could find:

If you want someone else to do it all for you

Metadata

Release files for bug-trail-core 3.1.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 bug-trail-core 3.1.0
File Size Uploaded
bug_trail_core-3.1.0.tar.gz 155.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bug-trail-core 3.1.0
File Interpreter ABI Platform
bug_trail_core-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 173.1 kB

Release files / bug_trail_core-3.1.0.tar.gz

Download URL bug_trail_core-3.1.0.tar.gz
Size 155.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0c13707530eca52975d44dc708d8a1ea681f3f4c49d140c9cc1955fa4469a754
BLAKE2b-256 checksum
How to use checksums
55876fa595a690c46f5942d3abc3f0f09c3160ee5cedcb8626e795bbee50dfc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 21, 2025.

Transparency log

Release files / bug_trail_core-3.1.0-py3-none-any.whl

Download URL bug_trail_core-3.1.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4578de1a2c0272067422367f9e82c7f4e281b265d8d91803fb2060dfc60d0bb5
BLAKE2b-256 checksum
How to use checksums
bac87813b32495d047e1295c4fa065c740f81345f3425b3feca313ca81a637d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 21, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 release files

3.0.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.0.1

2 release files

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