Skip to content

Commit 4532204

Browse files
committed
Improve logging for pedalboard screenshots
Signed-off-by: falkTX <[email protected]>
1 parent 704ee89 commit 4532204

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mod/screenshot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import os
66
import subprocess
77
import sys
8+
import logging
89

910
from tornado.ioloop import IOLoop
1011
from mod.settings import HTML_DIR, DEV_ENVIRONMENT, DEVICE_KEY, CACHE_DIR
@@ -27,7 +28,7 @@ def generate_screenshot(bundle_path, callback):
2728
cmd = [os.path.join(cwd, 'mod-pedalboard'), 'take_screenshot', bundle_path, HTML_DIR, CACHE_DIR]
2829
if sys.platform == 'win32':
2930
cmd[0] += ".exe"
30-
print(' '.join(cmd))
31+
logging.debug('[screenshot] now running: %s', ' '.join(cmd))
3132

3233
# regular run
3334
else:
@@ -44,6 +45,7 @@ def proc_callback():
4445
return
4546

4647
if not os.path.exists(screenshot) or not os.path.exists(thumbnail):
48+
logging.warn('[screenshot] process finished but image files do not exist')
4749
callback()
4850
return
4951

@@ -94,7 +96,7 @@ def img_callback(thumbnail=None):
9496
try:
9597
generate_screenshot(self.processing, img_callback)
9698
except Exception as ex:
97-
print('ERROR: {0}'.format(ex))
99+
logging.error('[screenshot] %s', ex)
98100
img_callback()
99101

100102
def check_screenshot(self, bundlepath):

0 commit comments

Comments
 (0)