我想将“check_call()”的“stdout”和“stderr”输出发送到 Syslog。这可能吗?
代码:
def command(cmd, err=None, ifexit=False):
try:
check_call(shlex.split(cmd), stdout=null, stderr=null)
except CalledProcessError:
if err != None:
print err
if ifexit == True:
exit(1)