Skip to content

Commit

Permalink
Enhance logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-kirienko committed Jan 22, 2024
1 parent fc66248 commit 2237db0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 2237db0

Please sign in to comment.