add some debug logging for audio bureau

workspace
Brendan Howell 6 years ago
parent 7b46a865fb
commit 54f117d330

@ -27,7 +27,9 @@ class Audio(Bureau):
only supports line-out signals on the default DAC.
"""
shortcode, _ = data.split(".")
self.log.debug("looking up shortcode " + shortcode)
url = self.urldb.get(shortcode)
self.log.debug(" playing url " + url)
subprocess.call(["mocp", "-c"])
subprocess.call(["mocp", "-a", url])
@ -67,6 +69,7 @@ class Audio(Bureau):
Prints the currently playing song or stream on the small printer.
"""
out = subprocess.check_output(["mocp", "-i"])
self.log.debug("info output:" + out)
self.print_small(out)
def save_url(self, url):

@ -62,6 +62,9 @@ class LogPrinter(logging.Handler):
"""
LogPrinter prints logs on a receipt printer for screenless debugging.
"""
def __init__(self):
logging.Handler.__init__(self)
def emit(self, record):
prn = printer.Usb(0x416, 0x5011, in_ep=0x81, out_ep=0x03)
msg = self.format(record)

Loading…
Cancel
Save