Skip to main content

Loggia

PyPI - Version PyPI - Python Version PyPI - License pdm-managed types - Mypy Hatch project linting - Ruff

The documentation is available on Github Pages

Read it online

Objective

The objective of this package is to provide a simple and standard way to configure logging in Python applications, using the standard logging module, and compatible with loguru.

We aim for a batteries-included, no configuration required, delightful out-of-the box experience.

The bundled configuration is opinionated and suits our purposes well, but we recognize your opinion will differ and provide various mechanisms of increasing complexity to tune logging to your liking.

Loggia is not a new Python logger - it's a nice way to configure - and share configuration - for Python's standard logging and as well as loguru.

!!! warning While this package is in an early 0.x release, it's built upon years of development and production usage in various projects.

Loggia as a logging configuration bundle is young, but the configuration
itself is what we most enjoyed working with for some time now.

Usage

  1. Add the loggia dependency to your project, e.g.: with PDM:
    • Directly from Pypi: pdm add loggia
    • With Git: pdm add "loggia @ git+ssh://git@github.com/manomanotech/loggia.git"
  2. #!python from loggia.logger import initialize; initialize() is a strong starting point
    • You should call this as early as possible in your application, ideally before any other code is run, for instance by adding it in your main __init__.py file.
  3. Read the Usage docs should you need to tune things.

Features

  • Delightful standard logging configuration in pretty or structured mode
  • Compatibility with loguru (WIP) - you can keep using Loguru's API as much as you like or need it, while Loggia takes care of all the other standard-logging based loggers.
  • Configuring sys.excepthook to properly log uncaught exceptions
  • Using logging.captureWarnings to log warnings
  • Configuring the standard logger and loguru to use the same handlers
  • Only one non-optional dependency

Code standards & Principles

  • Lean towards being way too typed rather than untyped
  • Do not depend on third-party packages (WIP)
  • Do not crash unless explicitly asked to - fallback to sensible things, emit a warning, and move on.

Supported versions

We currently support Python 3.9, 3.10, 3.11 and 3.12.

We may drop the support for a Python version before its end of life, to keep the codebase up to date with the latest Python features: i.e.: we will endeavor to support either the last 3 or 4 stable Python releases.

We don't plan to support earlier versions or different runtimes.

Metadata

Release files for loggia 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loggia 0.3.1
File Size Uploaded
loggia-0.3.1.tar.gz 40.4 kB Details

Built distribution (wheel)

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

Total release size: 77.4 kB

Release files / loggia-0.3.1.tar.gz

Download URL loggia-0.3.1.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6e6525819688e79e833c15d390af0d3f334c30080cd4e114667cb62192c23d09
BLAKE2b-256 checksum
How to use checksums
1496f2a12aa2998517f5c2daa3d3c1a8accb0b76fa98b1a2c636a797fe9bae6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.13.2 CPython/3.10.12 Linux/6.5.0-1016-azure

Release files / loggia-0.3.1-py3-none-any.whl

Download URL loggia-0.3.1-py3-none-any.whl
Size 37.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7b6b21ec129bbeb39332f61e6bea2a08443a2d0185b2aecb0ca51b5f77bfa45
BLAKE2b-256 checksum
How to use checksums
9d96b11e39dfd2d36ced3a03e250513290ff7b9575d67b5bf4cf13e2ee4797f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.13.2 CPython/3.10.12 Linux/6.5.0-1016-azure

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

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