code: def write(self, string):
          
          string = string.rstrip()
          if string:  # Don't log empty lines
              self.logger.critical(string)
docs: Erase newline from a string and write to the logger.