From 2237db01356b75eae75881cadcd2161d93582784 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Mon, 22 Jan 2024 15:25:04 +0200 Subject: [PATCH] Enhance logging --- tests/subprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/subprocess.py b/tests/subprocess.py index ea03d67..d2a21ca 100644 --- a/tests/subprocess.py +++ b/tests/subprocess.py @@ -120,7 +120,7 @@ class Subprocess: def __init__(self, *args: str, environment_variables: typing.Optional[typing.Dict[str, str]] = None): cmd = _make_process_args(*args) - _logger.info("Starting subprocess: %s", cmd) + _logger.debug("Starting subprocess: %s", cmd) if sys.platform.startswith("win"): # pragma: no cover # If the current process group is used, CTRL_C_EVENT will kill the parent and everyone in the group! @@ -129,7 +129,6 @@ def __init__(self, *args: str, environment_variables: typing.Optional[typing.Dic creationflags = 0 env = _get_env(environment_variables) - _logger.debug("Environment: %s", env) # Can't use PIPE because it is too small on Windows, causing the process to block on stdout/stderr writes. # Instead we redirect stdout/stderr to temporary files whose size is unlimited, and read them later. self._stdout = NamedTemporaryFile(suffix=".out", buffering=0) # pylint: disable=consider-using-with @@ -145,6 +144,7 @@ def __init__(self, *args: str, environment_variables: typing.Optional[typing.Dic creationflags=creationflags, bufsize=0, ) + _logger.info("PID %d started: %s\n%s", self.pid, cmd, env) @staticmethod def cli(*args: str, environment_variables: typing.Optional[typing.Dict[str, str]] = None) -> Subprocess: