code: def _set_defaults(self, log_level=logging.INFO, redirect_stdout=False):
          
  
          # Remove all previous handlers
          for handler in self.handlers[:]:
              self.removeHandler(handler)
  
          # Set levels
          self.setLevel(logging.DEBUG)
  
          # Set up the stdout handler
          self.fh = None
          self.sh = logging.StreamHandler()
          self.sh.emit = colored_formatter
          self.addHandler(self.sh)
  
          self.sh.setLevel(log_level)
  
          # warnings.showwarning = self._show_warning
  
          # Redirects all stdout to the logger
          if redirect_stdout:
              sys.stdout = LoggerStdout(self._print)
  
          # Catches exceptions
          sys.excepthook = self._catch_exceptions
docs: Reset logger to its initial state.