feat: update logging
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user