Log file cleanup + improvements
-Don't show queue timeout as error -Show UTC time and current timezone on pypo startup
This commit is contained in:
parent
263ba02481
commit
7f735fe2fa
|
@ -2,8 +2,10 @@
|
|||
Python part of radio playout (pypo)
|
||||
"""
|
||||
|
||||
import time
|
||||
from optparse import OptionParser
|
||||
from datetime import datetime
|
||||
|
||||
import time
|
||||
import sys
|
||||
import signal
|
||||
import logging
|
||||
|
@ -124,6 +126,12 @@ if __name__ == '__main__':
|
|||
logger.info('# Liquidsoap Scheduled Playout System #')
|
||||
logger.info('###########################################')
|
||||
|
||||
#Although all of our calculations are in UTC, it is useful to know what timezone
|
||||
#the local machine is, so that we have a reference for what time the actual
|
||||
#log entries were made
|
||||
logger.info("Timezone: %s" % time.tzname)
|
||||
logger.info("UTC time: %s" % datetime.utcnow())
|
||||
|
||||
signal.signal(signal.SIGINT, keyboardInterruptHandler)
|
||||
|
||||
# initialize
|
||||
|
|
|
@ -9,6 +9,8 @@ import telnetlib
|
|||
import copy
|
||||
from threading import Thread
|
||||
|
||||
from Queue import Empty
|
||||
|
||||
from api_clients import api_client
|
||||
from std_err_override import LogWriter
|
||||
|
||||
|
@ -493,6 +495,8 @@ class PypoFetch(Thread):
|
|||
|
||||
message = self.fetch_queue.get(block=True, timeout=self.listener_timeout)
|
||||
self.handle_message(message)
|
||||
except Empty, e:
|
||||
self.logger.info("Queue timeout. Fetching schedule manually")
|
||||
except Exception, e:
|
||||
import traceback
|
||||
top = traceback.format_exc()
|
||||
|
|
Loading…
Reference in New Issue