Structured logging library for the molcrafts ecosystem
Project description
mollog
Structured logging for Python with a stdlib-compatible API — no import logging required.
Quick Start
import mollog
mollog.configure(
level="INFO",
format="%(asctime)s %(levelname)s %(name)s %(message)s",
)
mollog.get_logger("httpx").set_level("WARNING") # silence noisy library
mollog.info("service booted", port=8080)
mollog.configure(...) accepts the same format= strings as logging.basicConfig, and by default installs a bridge so records emitted by libraries that still use stdlib logging (httpx, urllib3, openai, …) flow through mollog's hierarchy. Disable with capture_stdlib=False.
pip install molcrafts-mollog
# with optional logfire backend
pip install "molcrafts-mollog[logfire]"
Features
- Drop-in for
logging.basicConfig: stdlib-styleformat=strings and stdlib bridge - Top-level helpers:
mollog.{trace, debug, info, warning, error, critical, exception} - Per-logger level control:
mollog.get_logger("httpx").set_level("WARNING")(propagates to stdlib) - Named loggers with hierarchy and propagation
- Structured
extrafields andLogger.bind()for reusable context - Context-local fields via the
Contextnamespace (Context.scope(...)doubles as a logfire span) - Exception and stack capture on every record
TextFormatter,JSONFormatter,RichFormatter, and stdlib-styleStdlibStyleFormatterStreamHandler,FileHandler,RotatingFileHandler,TimedRotatingFileHandler,QueueHandler- Optional
LogfireHandler+configure_logfire()for Pydantic Logfire backends configure()andshutdown()for application lifecycle
Built with love by MolCrafts
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file molcrafts_mollog-1.2.0.tar.gz.
File metadata
- Download URL: molcrafts_mollog-1.2.0.tar.gz
- Upload date:
- Size: 40.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f919c24bd43085e508d47d41baf919d205da9ca6efdb1541be9853d87421e38f
|
|
| MD5 |
e55d0a24486545b0e482370b7cca0be4
|
|
| BLAKE2b-256 |
7a7975e04370662d6e4392563eebe6f74a84449c205d39d10f2490142de75cef
|
Provenance
The following attestation bundles were made for molcrafts_mollog-1.2.0.tar.gz:
Publisher:
release.yml on MolCrafts/mollog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molcrafts_mollog-1.2.0.tar.gz -
Subject digest:
f919c24bd43085e508d47d41baf919d205da9ca6efdb1541be9853d87421e38f - Sigstore transparency entry: 1493709570
- Sigstore integration time:
-
Permalink:
MolCrafts/mollog@062528a18e9ad52708addcfe34169ddc90159753 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/MolCrafts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@062528a18e9ad52708addcfe34169ddc90159753 -
Trigger Event:
push
-
Statement type:
File details
Details for the file molcrafts_mollog-1.2.0-py3-none-any.whl.
File metadata
- Download URL: molcrafts_mollog-1.2.0-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ff30d5bf2acf4945ff0ce1ff66d69892d840fc54bb9b8e93f7f0e58ff73ed25
|
|
| MD5 |
c3f6546b627a1a6bd3c1180a3a27bb88
|
|
| BLAKE2b-256 |
b63a5591d6082a44b8c94a1aa25e3b0f844e27a8d6907e616a5391479272f5b5
|
Provenance
The following attestation bundles were made for molcrafts_mollog-1.2.0-py3-none-any.whl:
Publisher:
release.yml on MolCrafts/mollog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molcrafts_mollog-1.2.0-py3-none-any.whl -
Subject digest:
0ff30d5bf2acf4945ff0ce1ff66d69892d840fc54bb9b8e93f7f0e58ff73ed25 - Sigstore transparency entry: 1493709686
- Sigstore integration time:
-
Permalink:
MolCrafts/mollog@062528a18e9ad52708addcfe34169ddc90159753 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/MolCrafts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@062528a18e9ad52708addcfe34169ddc90159753 -
Trigger Event:
push
-
Statement type: