feat: update logging

This commit is contained in:
2023-03-14 23:59:58 +03:00
parent ccdbb00eff
commit 9345b27aef
9 changed files with 180 additions and 31 deletions
+3 -3
View File
@@ -5,7 +5,7 @@ import logging
import subprocess
from pathlib import Path
logger = logging.getLogger("command")
logger = logging.getLogger(">")
class Command:
@@ -17,14 +17,14 @@ class Command:
def run(self, basepath: Path):
args = [self._executor, *self._args]
self._logger.info(" ".join(args))
self._logger.debug(" ".join(args))
result = subprocess.run(
args,
cwd=basepath,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
self._logstd(result.stdout, logging.DEBUG)
self._logstd(result.stdout, logging.TRACE)
if result.returncode != 0:
self._logstd(result.stderr, logging.ERROR)
raise RuntimeError(result.stderr)