Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

propagate the config for logging to batch jobs #25

Closed
TaiSakuma opened this issue Feb 25, 2018 · 3 comments
Closed

propagate the config for logging to batch jobs #25

TaiSakuma opened this issue Feb 25, 2018 · 3 comments

Comments

@TaiSakuma
Copy link
Member

propagate the config for logging to batch jobs

@TaiSakuma
Copy link
Member Author

  • loggers cannot be pickled in python 2.7 or 3.6
  • loggers can be pickled in python 3.7

@TaiSakuma
Copy link
Member Author

class LoggingListener(multiprocessing.Process):
    def __init__(self, queue):
        multiprocessing.Process.__init__(self)
        self.queue = queue

    def run(self):
        while True:
            record = self.queue.get()
            if record is None:
                break
            logger = logging.getLogger(record.name)
            logger.handle(record)

the logger in the main process won't received the record.

@TaiSakuma
Copy link
Member Author

implemented: 611214e

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant