Skip to main content

Modellogger

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

Usage

Install in a poetry project: poetry add git+https://github.com/mlcommons/modellogger.git

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

from modellogger.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 modellogger.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 modellogger.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

Metadata

Release files for airr-modellogger 0.1.2

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

Source distribution (sdist)

Source distribution for airr-modellogger 0.1.2
File Size Uploaded Provenance
airr_modellogger-0.1.2.tar.gz 6.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for airr-modellogger 0.1.2
File Interpreter ABI Platform
airr_modellogger-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / airr_modellogger-0.1.2.tar.gz

Download URL airr_modellogger-0.1.2.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
175a654a941e328903ce676c93a0da9a78e1c13fc24f439e411be3f026aa45d1
BLAKE2b-256 checksum
How to use checksums
a24f99478e73191548130feb48281c4bd1ac56049665b419b58dc0b022272a93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.13.4 Darwin/25.2.0

Release files / airr_modellogger-0.1.2-py3-none-any.whl

Download URL airr_modellogger-0.1.2-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70c3c225f6a79e8cd9a30c018e015cbcd6f5166416961560e8f6f9639916ad75
BLAKE2b-256 checksum
How to use checksums
cd99c9cec5bfbfca85a31237a44a5ec7e2aeeb634c46d3c4dbb2fa5e16ef6626
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.13.4 Darwin/25.2.0

Security for airr-modellogger 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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