def set_up_logging(log_file: Optional[str] = None) -> None:
    """Set up logging to file, if *log_file* is given, otherwise to console.

    :param log_file: file where to log messages, if any.
    """
    logging.basicConfig(filename=log_file, level=logging.INFO,
                        format="%(asctime)s %(levelname)s: %(message)s")
Set up logging to file, if *log_file* is given, otherwise to console.

    :param log_file: file where to log messages, if any.
    
patroni/scripts/barman/utils.py