Change how the alert name is found to use the class's __name__ property

This commit is contained in:
Andrew Resch 2008-12-31 02:47:17 +00:00
commit f97273e094

View file

@ -90,8 +90,7 @@ class AlertManager(component.Component):
alert = self.session.pop_alert() alert = self.session.pop_alert()
while alert is not None: while alert is not None:
# Loop through all alerts in the queue # Loop through all alerts in the queue
# Do some magic to get the alert type as a string alert_type = type(alert).__name__
alert_type = str(type(alert)).split("'")[1].split(".")[-1]
# Display the alert message # Display the alert message
log.debug("%s: %s", alert_type, alert.message()) log.debug("%s: %s", alert_type, alert.message())
# Call any handlers for this alert type # Call any handlers for this alert type