当前位置: 首页>>代码示例>>Python>>正文


Python syslog.closelog方法代码示例

本文整理汇总了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() 
开发者ID:sippy,项目名称:rtp_cluster,代码行数:21,代码来源:SipLogger.py

示例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() 
开发者ID:dw,项目名称:mitogen,代码行数:25,代码来源:core.py

示例3: closelog

# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def closelog(self):
        del self.log 
开发者ID:sippy,项目名称:rtp_cluster,代码行数:4,代码来源:SipLogger.py

示例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 ------------------------ 
开发者ID:jgyates,项目名称:genmon,代码行数:15,代码来源:gensyslog.py

示例5: close

# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def close():
    syslog.closelog() 
开发者ID:kdart,项目名称:pycopia,代码行数:4,代码来源:logging.py

示例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() 
开发者ID:radish-bdd,项目名称:radish,代码行数:7,代码来源:syslog_writer.py

示例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) 
开发者ID:bit-team,项目名称:backintime,代码行数:6,代码来源:logger.py

示例8: closelog

# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def closelog():
    syslog.closelog() 
开发者ID:bit-team,项目名称:backintime,代码行数:4,代码来源:logger.py

示例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) 
开发者ID:Runbook,项目名称:runbook,代码行数:10,代码来源:rel8-02-14.py

示例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) 
开发者ID:Runbook,项目名称:runbook,代码行数:10,代码来源:rel12-20-14.py

示例11: close

# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def close(self):
    """ See logging.Handler.close. """
    syslog.closelog()
    super().close() 
开发者ID:desbma,项目名称:hddfancontrol,代码行数:6,代码来源:__init__.py

示例12: closeLog

# 需要导入模块: import syslog [as 别名]
# 或者: from syslog import closelog [as 别名]
def closeLog(self):
        syslog.closelog() 
开发者ID:lmco,项目名称:laikaboss,代码行数:4,代码来源:laikamilter.py


注:本文中的syslog.closelog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。