Skip to main content

logging utility

Project description

balsa (logging utility)

Simple to use package that sets up Python logging. With just a few lines of code get well formatted logging to the console, log file, popup windows and exception services.

Here is a short Presentation on Balsa.

Installation

pip install balsa

Major Features

  • Simple to use. Add full-featured Python logging in just a few lines of code.

  • Sane default log levels. Single verbose flag. (All levels can be overridden if desired.)

  • Both console (stdout) and GUI (popup window) support.

  • Log file support. Uses appdirs for log file paths.

  • Structured logging (optional - you can still use simple strings and/or legacy logging string formatting).

  • Sentry support. Just provide your Sentry DSN.

  • Informative log message formatting (or you can change it if you like).

  • ISO 8601 timestamp format (with fractional seconds).

  • Cross platform (Windows, Linux, MacOS). Pure Python.

Simple Example

from balsa import get_logger, Balsa

application_name = 'example'

log = get_logger(application_name)


def main():
    balsa = Balsa(application_name, 'james abel')
    balsa.init_logger()
    log.error('my error example')

This will yield output of this form:

2021-10-24T10:49:04.150790-07:00 - example - balsa_simple_example.py - 12 - main - ERROR - my error example

Releases

  • 0.9 : Add structured logging and ISO 8601 timestamp format.

  • 0.6 : Add rate control to popup windows. Automated GUI testing.

  • 0.5 : Allow more than one logger.

  • 0.3 : Initial release.

Where did the name come from?

Balsa lumber is very soft and light, with a coarse, open grain. The Balsa package is light weight, malleable, and open source.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

balsa-0.17.2b0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file balsa-0.17.2b0-py3-none-any.whl.

File metadata

  • Download URL: balsa-0.17.2b0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.5

File hashes

Hashes for balsa-0.17.2b0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c46c34b39229135d1b2fea4d1799897830dafb35698f89f55251dec3c29eae6
MD5 9aa10b6ec70aeace7dd24501704c14b3
BLAKE2b-256 d27c46a36a89a82aed7be3963306b477404e8eb57e77a735a23ce67257b6fb37

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