本文整理汇总了Python中syslog.closelog方法的典型用法代码示例。如果您正苦于以下问题:Python syslog.closelog方法的具体用法?Python syslog.closelog怎么用?Python syslog.closelog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类syslog
的用法示例。
在下文中一共展示了syslog.closelog方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def run(self):
self.safe_open()
while True:
self.master.wi_available.acquire()
while len(self.master.wi) == 0:
self.master.wi_available.wait()
op, args, kwargs = self.master.wi.pop(0)
self.master.wi_available.release()
if op == 'reopen':
self.safe_open()
continue
if op == 'shutdown':
self.closelog()
return
try:
self.do_write(self.master.format(args, kwargs))
except:
# Reopen on any errror, drop message and continue
self.safe_open()
示例2: _do_broker_main
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def _do_broker_main(self):
"""
Broker thread main function. Dispatches IO events until
:meth:`shutdown` is called.
"""
# For Python 2.4, no way to retrieve ident except on thread.
self._waker.protocol.broker_ident = thread.get_ident()
try:
while self._alive:
self._loop_once()
fire(self, 'before_shutdown')
fire(self, 'shutdown')
self._broker_shutdown()
except Exception:
e = sys.exc_info()[1]
LOG.exception('broker crashed')
syslog.syslog(syslog.LOG_ERR, 'broker crashed: %s' % (e,))
syslog.closelog() # prevent test 'fd leak'.
self._alive = False # Ensure _alive is consistent on crash.
self._exitted = True
self._broker_exit()
示例3: closelog
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def closelog(self):
del self.log
示例4: SendNotice
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def SendNotice(Message):
try:
syslog.openlog("genmon")
syslog.syslog("%s" % Message)
syslog.closelog()
except Exception as e1:
log.error("Error: " + str(e1))
console.error("Error: " + str(e1))
#------------------- Command-line interface for gengpio ------------------------
示例5: close
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def close():
syslog.closelog()
示例6: syslog_writer_after_all
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def syslog_writer_after_all(self, features):
import syslog
syslog.syslog("end run {}".format(self.marker))
syslog.closelog()
示例7: openlog
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def openlog():
name = os.getenv('LOGNAME', 'unknown')
syslog.openlog("%s (%s/1)" %(APP_NAME, name))
atexit.register(closelog)
示例8: closelog
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def closelog():
syslog.closelog()
示例9: killhandle
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def killhandle(signum, frame):
''' This will close connections cleanly '''
line = "SIGTERM detected, shutting down"
syslog.syslog(syslog.LOG_INFO, line)
rdb_server.close()
zsend.close() # zsend?
syslog.closelog()
sys.exit(0)
示例10: killhandle
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def killhandle(signum, frame):
''' This will close connections cleanly '''
line = "SIGTERM detected, shutting down"
syslog.syslog(syslog.LOG_INFO, line)
rdb_server.close()
# zsend.close() # zsend?
syslog.closelog()
sys.exit(0)
示例11: close
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def close(self):
""" See logging.Handler.close. """
syslog.closelog()
super().close()
示例12: closeLog
# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def closeLog(self):
syslog.closelog()