Skip to main content

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

Reason this release was yanked:

missing required deps from pyproject.toml

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

pip install bug-trail

Usage

Configuration is optional via a pyproject.toml file.

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 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-1.0.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

bug_trail-1.0.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bug_trail-1.0.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for bug_trail-1.0.0.tar.gz
Algorithm Hash digest
SHA256 de41b386d1841db95fd972312223b91b4a4069a397fbc1bcf79577f74285e36e
MD5 bacd3174de1efe4ab6127d6e4ad25663
BLAKE2b-256 83460de895a9a06824aca3ecbd0818c52a04a75985adb5f2c74ed5d3b401ce9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bug_trail-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for bug_trail-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba45357ff721ae81e3782720fad7d845b15f10246d098d7af3a4a05e4460785d
MD5 617667934ba034c6209ef156af8d8fcb
BLAKE2b-256 c516d7fd6afb4fa791718ed5202d2bf5556cabbfe50dcb202d4aec1a6ef189b2

See more details on using hashes here.

Supported by

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