diff --git a/mod/screenshot.py b/mod/screenshot.py index a7e0a0d8..eefdb9e1 100644 --- a/mod/screenshot.py +++ b/mod/screenshot.py @@ -5,6 +5,7 @@ import os import subprocess import sys +import logging from tornado.ioloop import IOLoop from mod.settings import HTML_DIR, DEV_ENVIRONMENT, DEVICE_KEY, CACHE_DIR @@ -27,7 +28,7 @@ def generate_screenshot(bundle_path, callback): cmd = [os.path.join(cwd, 'mod-pedalboard'), 'take_screenshot', bundle_path, HTML_DIR, CACHE_DIR] if sys.platform == 'win32': cmd[0] += ".exe" - print(' '.join(cmd)) + logging.debug('[screenshot] now running: %s', ' '.join(cmd)) # regular run else: @@ -44,6 +45,7 @@ def proc_callback(): return if not os.path.exists(screenshot) or not os.path.exists(thumbnail): + logging.warn('[screenshot] process finished but image files do not exist') callback() return @@ -94,7 +96,7 @@ def img_callback(thumbnail=None): try: generate_screenshot(self.processing, img_callback) except Exception as ex: - print('ERROR: {0}'.format(ex)) + logging.error('[screenshot] %s', ex) img_callback() def check_screenshot(self, bundlepath):