本文整理汇总了Python中Logging.Logging.close方法的典型用法代码示例。如果您正苦于以下问题:Python Logging.close方法的具体用法?Python Logging.close怎么用?Python Logging.close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logging.Logging
的用法示例。
在下文中一共展示了Logging.close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Logging
# 需要导入模块: from Logging import Logging [as 别名]
# 或者: from Logging.Logging import close [as 别名]
self.request.send(b"false")
if __name__ == '__main__':
# First let's import some config files!
configFile = configparser.ConfigParser()
configFile.read('config.ini')
logging = Logging(configFile['General']['LogFile'])
address = (configFile['Server']['IP'], int(configFile['Server']['Port']))
server = socketserver.TCPServer(address, EchoRequestHandler)
ip, port = server.server_address # find out what port we were given
t = threading.Thread(target=server.serve_forever)
t.setDaemon(True) # don't hang on exit
t.start()
# Start the webserver
wserver = WebServer(configFile['Web']['IP'], configFile['Web']['Port'])
wserver.start_server()
try:
server.serve_forever()
except KeyboardInterrupt:
server.shutdown()
wserver.close_server()
logging.close() # Close the logging file