Add debug log

This commit is contained in:
Takeshi KOMIYA 2017-04-23 11:24:29 +09:00
parent 334d527e64
commit 7176d586cc

View File

@ -35,8 +35,9 @@ class ImagemagickConverter(ImageConverter):
# type: () -> bool # type: () -> bool
"""Confirms the converter is available or not.""" """Confirms the converter is available or not."""
try: try:
ret = subprocess.call([self.config.image_converter, '-version'], args = [self.config.image_converter, '-version']
stdin=subprocess.PIPE, stdout=subprocess.PIPE) logger.debug('Invoking %r ...', args)
ret = subprocess.call(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
if ret == 0: if ret == 0:
return True return True
else: else:
@ -54,6 +55,7 @@ class ImagemagickConverter(ImageConverter):
args = ([self.config.image_converter] + args = ([self.config.image_converter] +
self.config.image_converter_args + self.config.image_converter_args +
[_from, _to]) [_from, _to])
logger.debug('Invoking %r ...', args)
p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE) p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
except OSError as err: except OSError as err:
if err.errno != ENOENT: # No such file or directory if err.errno != ENOENT: # No such file or directory