From 586ab9c26154d5e5067486de447c4affae164b95 Mon Sep 17 00:00:00 2001 From: Lucas Bickel <116588+hairmare@users.noreply.github.com> Date: Tue, 12 Dec 2023 20:37:18 +0100 Subject: [PATCH] chore(smc-output): improve logging (#565) --- nowplaying/track/observers/smc_ftp.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nowplaying/track/observers/smc_ftp.py b/nowplaying/track/observers/smc_ftp.py index cb2807ee..28fee051 100644 --- a/nowplaying/track/observers/smc_ftp.py +++ b/nowplaying/track/observers/smc_ftp.py @@ -47,17 +47,20 @@ def __init__(self, options: Options): self._options = options def track_started(self, track: Track): - logger.info(f"Updating DAB+ DLS for track: {track.artist} - {track.title}") + logger.info(f"Updating DAB+ DLS for track {track.artist=} {track.title=}") if track.get_duration() < timedelta(seconds=5): - logger.info("Track is less than 5 seconds, not sending to SMC") + logger.info( + "Track is less than 5 seconds, not sending to SMC" + f"{track.artist=} {track.title=}" + ) return dls, dlplus = _dls_from_track(track) # check for too long meta and shorten to just artist if dls.getbuffer().nbytes > 128: # pragma: no cover - logger.warning(f"SMC DLS to long {dls=}") + logger.warning(f"SMC DLS to long {dls.getvalue().decode('latin1')=}") dls, dlplus = _dls_from_track(track, title=False) ftp = FTP_TLS() @@ -72,7 +75,9 @@ def track_started(self, track: Track): ftp.close() logger.info( - f"SMC FTP Server: {self._options.hostname} DLS: {dls} DL+: {dlplus}" + f"SMC FTP {self._options.hostname=} " + f"{dls.getvalue().decode('latin1')=} " + f"{dlplus.getvalue().decode('latin1')=}" ) def track_finished(self, track):