From 49b53b71f37c617848f502a592fa6ab9ed47f64b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= <sybren@stuvel.eu> Date: Thu, 15 Nov 2018 12:38:42 +0100 Subject: [PATCH] Send subprocess read-lines to separate logger This allows the logging config to mask those out if required. --- flamenco_worker/commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flamenco_worker/commands.py b/flamenco_worker/commands.py index 1557ca4e..d26ecdfc 100644 --- a/flamenco_worker/commands.py +++ b/flamenco_worker/commands.py @@ -458,6 +458,8 @@ class AbstractSubprocessCommand(AbstractCommand): self._log.info('Executing %s', cmd_to_log) await self.worker.register_log('Executing %s', cmd_to_log) + line_logger = self._log.getChild('line') + self.proc = await asyncio.create_subprocess_exec( *args, stdin=subprocess.DEVNULL, @@ -500,7 +502,7 @@ class AbstractSubprocessCommand(AbstractCommand): 'Command pid=%d produced non-UTF8 output, aborting: %s' % (pid, ex)) line = line.rstrip() - self._log.debug('Read line pid=%d: %s', pid, line) + line_logger.debug('Read line pid=%d: %s', pid, line) processed_line = await self.process_line(line) if processed_line is not None: await self.worker.register_log(processed_line) -- GitLab