Commit 7702fa4f authored by David Trattnig's avatar David Trattnig
Browse files

Improved logs for defect detection.

parent dc40738a
......@@ -30,7 +30,7 @@ import logging
from multiprocessing import Lock
from libraries.exceptions.auraexceptions import LQConnectionError
from libraries.enum.auraenumerations import TerminalColors
"""
LiquidSoapClient Class
......@@ -75,7 +75,7 @@ class LiquidSoapClient:
self.socket.connect(self.socket_path)
except socket.error as e:
msg = "Cannot connect to socketpath " + self.socket_path + ". Reason: "+str(e)
self.logger.critical(msg)
self.logger.critical(TerminalColors.RED.value+msg+TerminalColors.ENDC.value)
self.can_connect = False
self.connected = False
# raise e
......@@ -84,6 +84,9 @@ class LiquidSoapClient:
self.connected = True
return True
# AttributeError('characters_written')
# ------------------------------------------------------------------------------------------ #
def is_connected(self):
return self.connected
......@@ -131,7 +134,7 @@ class LiquidSoapClient:
self.mutex.release()
except Exception as e:
self.logger.error(str(e))
self.logger.error(TerminalColors.RED.value+str(e)+TerminalColors.ENDC.value)
self.mutex.release()
return data
......@@ -211,7 +214,7 @@ class LiquidSoapClient:
if not self.disable_logging:
self.logger.info("LiquidSoapClient got reply: " + self.message)
except BrokenPipeError as e:
self.logger.error("Detected a problem with liquidsoap connection while sending: " + message + ". Reason: " + str(e) + "! Trying to reconnect.")
self.logger.error(TerminalColors.RED.value+"Detected a problem with liquidsoap connection while sending: " + message + ". Reason: " + str(e) + "! Trying to reconnect."+TerminalColors.RED.value)
self.connect()
raise
......
......@@ -27,7 +27,8 @@ import logging
import datetime
import threading
from libraries.enum.auraenumerations import ScheduleEntryType
from libraries.enum.auraenumerations import ScheduleEntryType, TerminalColors
"""
LiquidSoapInitThread class.
......@@ -74,7 +75,7 @@ class LiquidSoapInitThread(threading.Thread):
self.liquidsoapcommunicator.is_liquidsoap_running = True
except Exception as e:
self.logger.critical("Liquidsoap connection ERROR! Restart LQ Server! Reason: "+str(e), e)
self.logger.critical(TerminalColors.RED.value+"Liquidsoap connection ERROR! Restart LQ Server! Reason: "+str(e)+TerminalColors.ENDC.value)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment