【发布时间】:2018-03-20 20:41:27
【问题描述】:
在 Python 的 Logging Cookbook 中,"A more elaborate multiprocessing example" 部分中有以下 cmets:
# The worker process configuration is just a QueueHandler attached to the
# root logger, which allows all messages to be sent to the queue.
# We disable existing loggers to disable the "setup" logger used in the
# parent process. This is needed on POSIX because the logger will
# be there in the child following a fork().
# The listener process configuration shows that the full flexibility of
# logging configuration is available to dispatch events to handlers however
# you want.
# We disable existing loggers to disable the "setup" logger used in the
# parent process. This is needed on POSIX because the logger will
# be there in the child following a fork().
在子进程中有父记录器到底有什么问题?
【问题讨论】:
-
回复您的评论 - 食谱只是展示您可以如何做事的指南 - 您可以随时根据您的具体需求调整代码。
标签: python logging multiprocessing posix child-process