semvec/pypi-packages huggingface dataset:
mp-logging 0.2
Python utility for easy multiprocessing + logging.
License: 0BSD
Keywords: multiprocessing logging

# MP-Logging
Multiprocessing logging (MP-Logging) provides a simple solution to the problem of
logging while using python multiprocessing.

## Install
```bash
pip install mp-logging
```

## Example
```python
import random
import time
from log import parallel, addlogging

@addlogging
def process(data):
    r = random.randint(0, 5)
    time.sleep(r)
    logger.info("Waited for %d seconds." % r)
    return True

if __name__ == "__main__":
    it = range(20)
    nprocs = 3
    chunksize = 1
    parallel(process, it, nprocs, chunksize)
```