def logger_handler(logger_: logging.Logger, handler: logging.Handler): logger_.addHandler(handler) try: yield None finally: handler.close() logger_.removeHandler(handler)
def close(self): if not self.stream.closed: self.stream.flush() self.stream.close() if not self.stream_lock.closed: self.stream_lock.close() Handler.close(self)
def close(self, timeout=None): Handler.close(self) try: self.producter.flush(timeout) except Exception: pass self.producter.close(timeout)
def disable_commands_handler(handler: logging.Handler) -> None: """Disable special handler for commands. :param handler: Handler returned by enable_commands_handler """ logging.getLogger().removeHandler(handler) handler.flush() handler.close()
def close(self): self.flush() self.acquire() try: self.target = NullHandler() Handler.close(self) finally: self.release()
def close(self): """ Closes the stream. """ if not self.stream.closed: self.stream.flush() self.stream.close() Handler.close(self)
def close(self): try: self._close() if not self.stream_lock.closed: self.stream_lock.close() finally: self.stream_lock = None Handler.close(self)
def close(self): """Flushes any remaining messages in the queue.""" if self.messages_pending: try: self.scribe_write(self._log_buffer) except self.ScribeHandlerException: pass Handler.close(self)
def close(self): self.target = None self.buffer = [] self.acquire() try: Handler.close(self) finally: self.release()
def close(self): """Close the producer and clean up.""" self.acquire() try: if self.producer: self.producer.close() Handler.close(self) finally: self.release()
def close(self): """ Closes the stream. """ if self.stream and not self.stream.closed: self.stream.flush() self.stream.close() if self.stream_lock and not self.stream_lock.closed: self.stream_lock.close() Handler.close(self)
def close(self): self.acquire() try: if self.__conn and self.__conn.is_open: self.__conn.close() self.__conn = None finally: self.release() Handler.close(self)
def close(self): try: self._close() if not self.stream_lock.closed: self.stream_lock.close() except AttributeError: pass finally: self.stream_lock = None Handler.close(self)
def close(self): """ Close log stream and stream_lock. """ self._console_log("In close()", stack=True) try: self._close() finally: self._do_file_unlock() self.stream_lock = None Handler.close(self)
def close(self): """ Close log stream and stream_lock. """ try: self._close() if not self.stream_lock.closed: self.stream_lock.close() finally: self.stream_lock = None Handler.close(self)
def close(self): self.acquire() try: if self.stream: self.flush() self.stream.close() self.stream = None Handler.close(self) finally: self.release()
def remove_handler(self, name: str, handler: python_logging.Handler) -> None: """Remove handler from module. Args: name: module name handler: Logging Handler """ logger = python_logging.getLogger(name) handler.close() logger.removeHandler(handler)
def close(self): """ Close log stream and stream_lock. """ try: self._close() if hasattr(self.stream_lock, 'closed') and \ not self.stream_lock.closed: self.stream_lock.close() finally: self.stream_lock = None if Handler: Handler.close(self)
def close(self): """ 关闭文件流,并释放锁 :return : None """ try: self._close() if not self.stream_lock.closed: self.stream_lock.close() finally: self.stream_lock = None Handler.close(self)
def close(self): """Tidy up before removing from list of handlers""" self.logMessages = {} Handler.close(self)
def close(self): Handler.close(self) syslog.closelog()
def close(self): r""" """ Handler.close(self)
def close(self): self._handler.close() LogHandler.close(self)
def closeHandler(oldHandler: logging.Handler): oldHandler.flush() oldHandler.close() rootLogger.removeHandler(oldHandler)
def close(self): print("SocketIOHandler close called!") Handler.close(self) self.socketio_client.close()
def close(self): """Tell the server we're done with the file. It will know to close the file once all clients are done with it.""" Handler.close(self) self.client.done(self.client_id, self.filepath)