parameters: (
          logger,
          level,
          log_file="",
          backupCount=10,
          maxBytes=10000000)
docstring: Turns on formatted logging output as configured.
docstring_summary: Turns on formatted logging output as configured.
docstring_tokens: Turns on formatted logging output as configured .
function: def enable_pretty_logging(
          logger,
          level,
          log_file="",
          backupCount=10,
          maxBytes=10000000):
      """Turns on formatted logging output as configured.
      """
      if logger is None:
          raise error.BigflowPlanningException("logger cannot be None")
  
      if "__PYTHON_IN_REMOTE_SIDE" in os.environ:
          # Do not do logging at runtime
          logger.addHandler(logging.NullHandler())
      else:
          logger.setLevel(level)
  
          if log_file:
              channel = logging.handlers.RotatingFileHandler(
                  filename=log_file,
                  maxBytes=maxBytes,
                  backupCount=backupCount)
              channel.setFormatter(LogFormatter(color=False))
              logger.addHandler(channel)
  
          if not logger.handlers:
              # Set up color if we are in a tty and curses is installed
              channel = logging.StreamHandler()
              channel.setFormatter(LogFormatter())
              logger.addHandler(channel)
function_tokens: def enable_pretty_logging ( logger , level , log_file = "" , backupCount = 10 , maxBytes = 10000000 ) : if logger is None : raise error . BigflowPlanningException ( "logger cannot be None" ) if "__PYTHON_IN_REMOTE_SIDE" in os . environ : # Do not do logging at runtime logger . addHandler ( logging . NullHandler ( ) ) else : logger . setLevel ( level ) if log_file : channel = logging . handlers . RotatingFileHandler ( filename = log_file , maxBytes = maxBytes , backupCount = backupCount ) channel . setFormatter ( LogFormatter ( color = False ) ) logger . addHandler ( channel ) if not logger . handlers : # Set up color if we are in a tty and curses is installed channel = logging . StreamHandler ( ) channel . setFormatter ( LogFormatter ( ) ) logger . addHandler ( channel )