Python syslog 模块,closelog() 实例源码

我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用syslog.closelog()

项目:TOR-Hidden-Service-Verification    作者:arrase    | 项目源码 | 文件源码
def close(self):
        syslog.syslog(syslog.LOG_INFO, 'Closing HSVerifyd')
        syslog.closelog()
项目:python-application    作者:AGProjects    | 项目源码 | 文件源码
def close(self):
        syslog.closelog()
        logging.Handler.close(self)
项目:broadview-collector    作者:openstack    | 项目源码 | 文件源码
def __del__(self):
        syslog.closelog()
项目:megadld    作者:arrase    | 项目源码 | 文件源码
def close(self):
        syslog.syslog(syslog.LOG_INFO, 'Closing megadld')
        syslog.closelog()
项目:sdic    作者:percolate    | 项目源码 | 文件源码
def main():
    args = docopt(__doc__,
                  version="sdic {}".format(VERSION))

    # Check that the given directory exists
    if not isdir(args['<directory>']):
        error("The folder {} does not exist".format(args['<directory>']))

    # Try to get the config of the servers we are gonna use
    servers = get_servers_from_config(args['<directory>'])

    # Check that we are not already running
    program_name = os.path.basename(sys.argv[0])
    lock = FileLock("/tmp/{}.lock".format(program_name))
    if lock.is_locked():
        error("{} is already running. Delete {} if it's a mistake.".format(
            program_name, lock.path))

    # Everything's ok, run the main program
    with lock:
        syslog.openlog('sdic')

        has_output = False
        if not args['<server>']:
            for server in servers:
                if launch_queries(args['<directory>'], server):
                    has_output = True
        else:
            for server in servers:
                if server['name'] == args['<server>']:
                    if launch_queries(args['<directory>'], server):
                        has_output = True
        if has_output:
            return 1

        syslog.closelog()
项目:logdevourer    作者:Korbank    | 项目源码 | 文件源码
def close(self):
        syslog.closelog()
        super(SysLogHandler, self).close()
项目:homeassistant    作者:NAStools    | 项目源码 | 文件源码
def send_message(self, message="", **kwargs):
        """Send a message to a user."""
        import syslog

        title = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)

        syslog.openlog(title, self._option, self._facility)
        syslog.syslog(self._priority, message)
        syslog.closelog()