Collect log messages and progress updates from multiple processes.
Project description
manylog
The manylog package facilitates logging and progress reporting in Python
multiprocessing settings. Right now, logging across process doesn't work
well, except for the natural interleaving that sometimes works acceptably
when using the fork multiprocessing context. It supports log messages
through the Python standard library's logging module, and progress reported
with progress-api.
This package fixes that, through two parts:
-
A listener that runs in a parent process, listening for log messages and progress updates. It republishes these log messages into the parent process's logging infrastructure so filters, handlers, etc. all apply.
-
Logging and progress backend for worker processes that forwards messages to the parent process.
It is agnostic to the specific multiprocessing framework in use, and will work with stdlib multiprocessing, joblib (although Joblib lacks the setup API needed to make it work easily), ipyparallel, Torch multiprocessing, and others. It uses ZeroMQ to route messages between parent and child processes.
Currently, only single-machine multiprocessing is supported, but ZeroMQ will make it easy to add cluster log and progress aggregation in the future.
Example
In the parent:
import multiprocessing.Pool
from manylog import LogListener, init_worker_logging
with LogListener() as ll, mp.Pool(4, init_worker_logging, (ll.address,), None, mp.get_context('spawn')) as pool:
# use `pool` to schedule parallel work
Log messages from worker processes will be routed through whatever logging and progress configuration you have set up.
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 manylog-0.1.0.tar.gz.
File metadata
- Download URL: manylog-0.1.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed8fbd4175eee0078a8b0529e736428547bc1ea29d42cff39bdceef179e89fc9
|
|
| MD5 |
004ca967fb9886344e10dedc9e7846b5
|
|
| BLAKE2b-256 |
f0151e6e80d2d2ab7bf80d4821c193de664d0ea0678d155822eb3f277d688c06
|
Provenance
The following attestation bundles were made for manylog-0.1.0.tar.gz:
Publisher:
package.yml on mdekstrand/manylog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
manylog-0.1.0.tar.gz -
Subject digest:
ed8fbd4175eee0078a8b0529e736428547bc1ea29d42cff39bdceef179e89fc9 - Sigstore transparency entry: 145542348
- Sigstore integration time:
-
Permalink:
mdekstrand/manylog@0592011daa8acdbdbf9632466cb39cc50ab4756c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mdekstrand
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yml@0592011daa8acdbdbf9632466cb39cc50ab4756c -
Trigger Event:
release
-
Statement type:
File details
Details for the file manylog-0.1.0-py3-none-any.whl.
File metadata
- Download URL: manylog-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1728c103d422d5853aaaddc1bd8ff3cbe50757f7290c9312907caacbcf1f271
|
|
| MD5 |
d22ebb37cff0560041540e48841046dc
|
|
| BLAKE2b-256 |
4805734952810be7e11f7d871f227c8ddc27907c23d76d15faff83845b960ede
|
Provenance
The following attestation bundles were made for manylog-0.1.0-py3-none-any.whl:
Publisher:
package.yml on mdekstrand/manylog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
manylog-0.1.0-py3-none-any.whl -
Subject digest:
d1728c103d422d5853aaaddc1bd8ff3cbe50757f7290c9312907caacbcf1f271 - Sigstore transparency entry: 145542350
- Sigstore integration time:
-
Permalink:
mdekstrand/manylog@0592011daa8acdbdbf9632466cb39cc50ab4756c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mdekstrand
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package.yml@0592011daa8acdbdbf9632466cb39cc50ab4756c -
Trigger Event:
release
-
Statement type: