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.11+

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. Unless you pass log_time_format, the time-only format (%H:%M:%S) is used, 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.

Metadata

Release files for simple-log-factory 2.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 2.0.0
File Size Uploaded Provenance Actions
simple_log_factory-2.0.0.tar.gz 33.9 kB With provenance Details for simple_log_factory-2.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 66.2 kB

Release files / simple_log_factory-2.0.0.tar.gz

Download URL simple_log_factory-2.0.0.tar.gz
Size 33.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9ae69c31f8c35ece2af86ebb212f6d81fdce4b21b4eba00f4787fcbb037e6aa4
BLAKE2b-256 checksum
How to use checksums
7ff67d9c7f6138d9f1feafc16749e2785a3d79af1d70292d6add6d0880ad5b23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 31, 2026.

Transparency log

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

Download URL simple_log_factory-2.0.0-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23da94900ddef66f1173fa597d082414f9a6569cecd9acf35c74a3aecc265a45
BLAKE2b-256 checksum
How to use checksums
521974a2e9ae2dac672b1662da8fce685086f404e20a574d0a800e7db3f6442b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 31, 2026.

Transparency log

Security for simple-log-factory 2.0.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for simple_log_factory-2.0.0.tar.gz

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 Oct 31, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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