code: def cli(ctx, verbose, config):
      
      assert isinstance(ctx, Context)
      # Set up the logger
      verbose = verbose if (verbose <= 3) else 3
      log_levels = {1: logging.WARN, 2: logging.INFO, 3: logging.DEBUG}
      log_level = log_levels[verbose]
  
      ctx.log = logging.getLogger('ipsv')
      ctx.log.setLevel(log_level)
  
      # Console logger
      console_format = logging.Formatter("[%(levelname)s] %(name)s: %(message)s")
      ch = logging.StreamHandler()
      ch.setLevel(log_level)
      ch.setFormatter(console_format)
      ctx.log.addHandler(ch)
  
      # File logger
      file_format = logging.Formatter("[%(asctime)s] [%(levelname)s] %(name)s: %(message)s")
      file_logger = logging.FileHandler(os.path.join(ctx.config.get('Paths', 'Log'), 'ipsv.log'))
      file_logger.setLevel(log_level)
      file_logger.setFormatter(file_format)
      ctx.log.addHandler(file_logger)
  
      # Load the configuration
      if os.path.isfile(config):
          ctx.config_path = config
          ctx.log.debug('Loading configuration: %s', ctx.config_path)
          ctx.load_config(config)
      else:
          ctx.config_path = os.path.join(ctx.basedir, 'config', 'ipsv.conf')
          ctx.log.debug('Loading default configuration: %s', ctx.config_path)
  
      ctx.setup()
docs: IPS Vagrant Management Utility