1
0
mirror of https://github.com/gryf/fs-uae-wrapper.git synced 2025-12-19 04:20:23 +01:00

Use logging for displaying messages

Also added debug logs
This commit is contained in:
2017-01-08 13:29:23 +01:00
parent a918e4c9ff
commit 152446abbe
4 changed files with 38 additions and 30 deletions

View File

@@ -2,9 +2,9 @@
Misc utilities
"""
from distutils import spawn
import logging
import os
import subprocess
import sys
try:
import configparser
except ImportError:
@@ -115,10 +115,10 @@ def run_command(cmd):
if not isinstance(cmd, list):
cmd = cmd.split()
logging.debug("Executing `%s'.", " ".join(cmd))
code = subprocess.call(cmd)
if code != 0:
sys.stderr.write('Command `{0}` returned non 0 exit '
'code\n'.format(cmd[0]))
logging.error('Command `%s` returned non 0 exit code.', cmd[0])
return False
return True