Skip to main content

Simple Log Factory

A lightweight wrapper around Python's built-in logging module that creates pre-configured loggers with sensible defaults.

Requires Python 3.9+

Installation

pip install simple_log_factory

Usage

Basic console logger (DEBUG level)

from simple_log_factory import log_factory

logger = log_factory("my_app")
logger.info("Application started")

Console + rotating file logger

The file log rotates daily at midnight. The time-only format (%H:%M:%S) is used automatically for the file handler since the date is encoded in the filename.

from simple_log_factory import log_factory

logger = log_factory("my_app", log_file="./app.log")

Console + static file logger

from simple_log_factory import log_factory

logger = log_factory("my_app", log_file="./app.log", rotate_file_by_day=False)

Deduplicate handlers

Prevent duplicate output when multiple loggers write to the same destination:

from simple_log_factory import log_factory

logger = log_factory("my_app", unique_handler_types=True)

LogContext and LogContextGenerators

LogContextGenerators creates context-bound loggers that inject extra key-value pairs into every log call:

from simple_log_factory import LogContextGenerators

gen = LogContextGenerators(log_name="my_app")
ctx = gen.get_logger_for_context(request_id="abc-123", user="alice")

ctx.info("Processing request")   # extra={request_id: "abc-123", user: "alice"}
ctx.error("Something went wrong")

The returned LogContext object is a frozen dataclass with attributes exception, error, warning, info, and debug.

Links

Release files for simple-log-factory 1.0.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 simple-log-factory 1.0.0
File Size Uploaded
simple_log_factory-1.0.0.tar.gz 33.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-log-factory 1.0.0
File Interpreter ABI Platform
simple_log_factory-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 65.3 kB

Release files / simple_log_factory-1.0.0.tar.gz

Download URL simple_log_factory-1.0.0.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
86fc6bbff7ea3eaef91b9b41b6a9ea754c56e52ea363a70e1386fe961b5d6bcb
BLAKE2b-256 checksum
How to use checksums
930bd284a35e187fd9c77cd2c1bd741b80994a91396a45c51016ef741ebd1291
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 7, 2026.

Transparency log

Release files / simple_log_factory-1.0.0-py3-none-any.whl

Download URL simple_log_factory-1.0.0-py3-none-any.whl
Size 31.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ea6c0793e0c227b6be6239325901f52ec3ec7abe78a28c699f3939f7facc6ae
BLAKE2b-256 checksum
How to use checksums
d51f020e9072522172e0943691281a1888ac7cbdbbc76ea5a9783a29593722e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Feb 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.0.1

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