{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/15"}],"enrichment":{"capability":"Provides a logging handler that tunnels log records from multiprocessing subprocesses to the main process, preventing garbled or lost log messages.","skillfed_tags":["multiprocessing","logging-handler","posix-only"],"use_cases":["Aggregate logs from a multiprocessing.Pool into a single file or stream without interleaving.","Centralize subprocess logging in a long-running daemon that spawns worker processes.","Debug parallel workloads by collecting all subprocess output in order at the main process.","Replace per-subprocess log files with a unified log when using fork-based multiprocessing.","Ensure log records from child processes reach configured handlers (files, syslog, etc.) in the main process."],"what_it_does":"multiprocessing-logging solves the problem of garbled or lost log messages when using Python's multiprocessing module. When subprocesses log independently, their output can interleave or be lost; this package installs a handler on the root logger that tunnels all log records from child processes back to the main process for centralized handling.\n\nThe module is simple to use: call `install_mp_handler()` after configuring logging but before spawning processes or creating a Pool. It relies on the fork start method for process creation and works on POSIX systems (Linux officially supported). The documentation notes a known limitation: fork-based process creation is unsafe when threads are also in use, creating a low probability of application hangs; the recommended workaround is to create a Pool once and reuse it rather than continuously spawning new processes.","worth_installing":"Yes, if you use multiprocessing on Linux and need reliable subprocess logging. The package is stable and has no security vulnerabilities, but maintenance is aging (last release 2023). Install before creating pools or spawning processes, and avoid continuous process creation to mitigate the known fork-threading hang risk. Not suitable for Windows."},"id":"multiprocessing-logging","links":{"html":"https://skillfed.io/packages/multiprocessing-logging","md":"https://skillfed.io/packages/multiprocessing-logging.md","pypi":"https://pypi.org/project/multiprocessing-logging/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2023-02-05","license_spdx":null,"license_treatment":"copyleft","name":"multiprocessing-logging","python_support":"unspecified","summary":"Logger for multiprocessing applications"},"popularity":{"monthly_downloads":242418,"position":8856,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.3.4"}
