Skip to main content

Local static html error logger to use while developing python code.

Project description

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

The handlers in bug-trail-core support python 3.9+. bug-trail, the report viewer supports python 3.11 and should be installed apart from your main app.

Install bug-trail-core 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_core
import logging

section = bug_trail_core.read_config(config_path="../pyproject.toml")
handler = bug_trail_core.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

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 Flak 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bug_trail-3.0.0.tar.gz (584.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bug_trail-3.0.0-py3-none-any.whl (264.2 kB view details)

Uploaded Python 3

File details

Details for the file bug_trail-3.0.0.tar.gz.

File metadata

  • Download URL: bug_trail-3.0.0.tar.gz
  • Upload date:
  • Size: 584.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for bug_trail-3.0.0.tar.gz
Algorithm Hash digest
SHA256 c687518297723125b3067a691a5d27ba038f40841902646264a0d6d3656fe4d0
MD5 21663816d46b73f4625c5d8205a271db
BLAKE2b-256 4f1f7943b241ad57b82d769cd3f250f665f6a1b84ea58fb0349d423a54116ae0

See more details on using hashes here.

Provenance

The following attestation bundles were made for bug_trail-3.0.0.tar.gz:

Publisher: build.yml on matthewdeanmartin/bug_trail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bug_trail-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: bug_trail-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 264.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for bug_trail-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36ab1edf8b992073a2111766a780cf953e170019406c1f79df46c70813411733
MD5 b5a02385195b65641fd8ad0bb80a09b6
BLAKE2b-256 2ad553ac5cdf417d635c8955d0a2b8ca19bb487046c86106b72871f5842b3fa7

See more details on using hashes here.

Provenance

The following attestation bundles were made for bug_trail-3.0.0-py3-none-any.whl:

Publisher: build.yml on matthewdeanmartin/bug_trail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page