Skip to main content

Python logging configuration library for MLCommons AIRR applications.

Project description

airrlogger

The airrlogger package provides a standardized logging configuration for AIRR applications.

Usage

Install in a poetry project: poetry add airrlogger

Near the top of any file where you want to log, do something like:

from airrlogger.log_config import get_logger
logger = get_logger(__name__)

Then as early as possible in your program's startup, tell it how to handle the logging:

import logging
from airrlogger.log_config import configure_logging

configure_logging(app_name="myapp", level=logging.INFO)

You can then log like this

    logger.info("some info logging")

The default output looks like this:

2026-01-09T21:14:13Z - myapp - __main__ - INFO - some info logging

DefaultFormatter

A class that formats log messages with UTC timestamps and optional ANSI color codes for console output.

configure_logging

A function that configure the root logger with console and optional file output.

from airrlogger.log_config import configure_logging

logger = configure_logging(app_name="modelrunner-api", file="./app.log", level=logging.DEBUG)

get_config_dict

Generates logging configuration dictionaries for use with logging.config.dictConfig. By default, the app name is derived from the package name, but that can be overridden.

This is particularly useful for FastAPI applications, which can adopt this logger by using something like:

run(app, host="0.0.0.0", port=port, log_config=get_config_dict(app_name="modelrunner-api"))

Example Output

2025-12-19T14:10:24Z - modelrunner-api - INFO - 127.0.0.1:36054 - "GET /health HTTP/1.1" 200

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

airrlogger-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airrlogger-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file airrlogger-0.1.0.tar.gz.

File metadata

  • Download URL: airrlogger-0.1.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.13.4 Darwin/25.2.0

File hashes

Hashes for airrlogger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f72d6838cbe9b994a3e86c754dac1c5879ab00464f4b495981d9555ccb362b0
MD5 006144fc96695bdb45e79ab82067a0fd
BLAKE2b-256 ab7bbe9496da5d9536a41fbf239008e83b65a0d480cb8383f3b059bf4cc0bda2

See more details on using hashes here.

File details

Details for the file airrlogger-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: airrlogger-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.13.4 Darwin/25.2.0

File hashes

Hashes for airrlogger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa5ffc2fdb10486ac1784dd770849ab890051f98351f75c99211c37910ec070d
MD5 de6d6bac1116ea8bf3d8002bc5578944
BLAKE2b-256 06bb0db7c11295c36ab10f565d1c36811a9bb04d121f0500d1a64e0d6ffbd47e

See more details on using hashes here.

Supported by

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