code: def connection_lost(self, exception):
          
          if exception:
              self.logger.exception('Connection lost!')
          else:
              self.logger.info('Connection lost')
docs: Called when the connection is lost or closed.
  
          The argument is either an exception object or None. The latter means
          a regular EOF is received, or the connection was aborted or closed by
          this side of the connection.