Skip to main content

balsa (logging utility)

CI Code coverage PyPI version Supported Python versions PyPI downloads per month Documentation status License

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, e.g. console_log_level.)

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

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

  • Structured logging via yasf.sf() (optional - you can still use simple strings).

  • Sentry support. Just provide your Sentry DSN. Set the BALSA_DEV environment variable to keep development-time errors out of Sentry.

  • Sentry structured logs support. Set use_sentry_logs to send log records to Sentry as searchable, first-class log entries (requires sentry-sdk 2.35+; sentry-sdk 3 is supported).

  • 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.

  • Multiprocessing support.

  • AWS CloudWatch logs support. Structured logs enable CloudWatch Logs Insights.

  • Optional error callback, e.g. to notify the user or exit on any error.

  • In-memory buffer of recent log lines via Balsa.get_string_list().

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')


if __name__ == '__main__':
    main()

This will yield output of this form:

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

More examples are in the examples directory.

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.

Metadata

Release files for balsa 0.27.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 balsa 0.27.0
File Size Uploaded Provenance Actions
balsa-0.27.0.tar.gz 297.4 kB With provenance Details for balsa-0.27.0.tar.gz

Built distribution (wheel)

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

Total release size: 317.2 kB

Release files / balsa-0.27.0.tar.gz

Download URL balsa-0.27.0.tar.gz
Size 297.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f4c5403b27f2950b09bc6eb71b90d5f3583e83601bc599663c9cf612e27338c5
BLAKE2b-256 checksum
How to use checksums
84be76228f7d13346a437c803c24e224f1793d2dca5fa7646ecc500ddd2dd8a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / balsa-0.27.0-py3-none-any.whl

Download URL balsa-0.27.0-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee0a41b62c25b570d0368fa89c6a10f8f742b327932959a8908fb6f2e7086681
BLAKE2b-256 checksum
How to use checksums
a90273921570bb013e2e526054b94f00a4315be6978d97fa39b1133e448649a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Security for balsa 0.27.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for balsa-0.27.0.tar.gz

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 Nov 24, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.27.0 This release

2 release files Full provenance

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