本文整理汇总了Python中logs.Logs.startTrimThread方法的典型用法代码示例。如果您正苦于以下问题:Python Logs.startTrimThread方法的具体用法?Python Logs.startTrimThread怎么用?Python Logs.startTrimThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logs.Logs
的用法示例。
在下文中一共展示了Logs.startTrimThread方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import startTrimThread [as 别名]
def __init__(self, jsonfile, logfile, sipcallfile, optsUpdateUI=None):
""" Init for the Worker class """
print("{0}------------ INIT FOR DOOR SENSOR CLASS! ----------------{1}"
.format(bcolors.HEADER, bcolors.ENDC))
# Global Variables
self.jsonfile = jsonfile
self.logfile = logfile
self.sipcallfile = sipcallfile
self.settings = self.ReadSettings()
self.limit = 10
self.logtypes = 'all'
# Stop execution on exit
self.kill_now = False
# Init Alarm
self.mynotify = Notify(self.settings)
self.mynotify.setupUpdateUI(optsUpdateUI)
self.mynotify.setupSendStateMQTT()
mylogs = Logs(self.logfile)
self.getSensorsLog = mylogs.getSensorsLog
self.writeLog("system", "Alarm Booted")
mylogs.startTrimThread()
# Event Listeners
self.sensors = Sensor()
self.sensors.on_alert(self.sensorAlert)
self.sensors.on_alert_stop(self.sensorStopAlert)
self.sensors.on_error(self.sensorError)
self.sensors.on_error_stop(self.sensorStopError)
self.sensors.add_sensors(self.settings)
# Init MQTT Messages
self.mynotify.on_disarm_mqtt(self.deactivateAlarm)
self.mynotify.on_arm_mqtt(self.activateAlarm)
self.mynotify.on_sensor_set_alert(self.sensorAlert)
self.mynotify.on_sensor_set_stopalert(self.sensorStopAlert)
self.mynotify.sendStateMQTT()