code: def setup_logger(logger=None, level='INFO'):
      
      if not logger:  # if no logger exists, make one
          logger = logging.getLogger()
  
      if not logger.handlers:  # setup logger handlers
          channel = logging.StreamHandler()
          channel.setFormatter(log.DebugLogFormatter())
  
          # channel.setFormatter(log.LogFormatter())
          logger.setLevel(level)
          logger.addHandler(channel)
docs: Setup logging for CLI use.
  
      Tries to do some conditionals to prevent handlers from being added twice.
      Just to be safe.
  
      Parameters
      ----------
      logger : :py:class:`Logger`
          logger instance for tmuxp