https://github.com/jamesabel/balsa
object-oriented python logging
https://github.com/jamesabel/balsa
logging
Last synced: 6 months ago
JSON representation
object-oriented python logging
- Host: GitHub
- URL: https://github.com/jamesabel/balsa
- Owner: jamesabel
- License: mit
- Created: 2018-03-13T04:41:23.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2025-01-03T06:43:30.000Z (over 1 year ago)
- Last Synced: 2026-01-02T21:47:45.273Z (6 months ago)
- Topics: logging
- Language: Python
- Homepage:
- Size: 2.1 MB
- Stars: 6
- Watchers: 1
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: readme.rst
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
.. this file is kept in the docs\source directory and COPIED to the project root directory.
.. DO NOT edit the copy in the project root directory.
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
============
.. code-block:: console
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 via `yasf.sf()` (optional - you can still use simple strings).
- `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.
- Multiprocessing support.
- `AWS CloudWatch logs `_ support.
Structured logs enable `CloudWatch Logs Insights`.
Simple Example
==============
.. code:: python
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:
.. code-block:: console
2021-10-24T10:49:04.150790-07:00 - example - balsa_simple_example.py - 12 - main - ERROR - my error example
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.