From edf7ddb75b2a59e82ff3c4b03fda68cf3efefa65 Mon Sep 17 00:00:00 2001
From: David Trattnig <david.trattnig@o94.at>
Date: Mon, 2 Mar 2020 16:40:25 +0100
Subject: [PATCH] Simplified logging in case of admin mail.

---
 modules/scheduling/fallback_manager.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/scheduling/fallback_manager.py b/modules/scheduling/fallback_manager.py
index 1d5300ca..9dd32bd4 100644
--- a/modules/scheduling/fallback_manager.py
+++ b/modules/scheduling/fallback_manager.py
@@ -126,8 +126,8 @@ class FallbackManager:
             file = ""
             self.logger.critical("Should set next fallback file for " + fallbackname + ", but this fallback is unknown!")
 
-        # Send admin email to notify about the fallback state
         if file:
+            # Send admin email to notify about the fallback state
             if not active_playlist:
                 active_playlist = "n/a"
             msg = "AURA ENGINE %s FALLBACK DETECTED!\n\n" % fallbackname
@@ -136,13 +136,20 @@ class FallbackManager:
             msg += "Providing FALLBACK-%s for %s '%s'\n\n" % (media_type, fallbackname, file)
             msg += "Please review the schedules or contact your Aura Engine administrator."
             self.mailer.send_admin_mail("CRITICAL - Detected fallback for %s" % fallbackname, msg)
-            self.logger.critical("Sent admin email:\n──────────────────────────────────────\n" + msg)
+            self.logger.warn("Providing fallback %s: '%s'. Sent admin email about fallback state" % (media_type, file))
 
         self.is_processing = False
         return file
 
 
 
+    def fallback_has_started(self, artist, title):
+        """
+        Called when a fallback track has actually started playing
+        """
+        self.logger.info("Now playing: fallback track '%s - %s'." % (artist, title))
+
+
     #
     #   PRIVATE METHODS
     #
-- 
GitLab