def METHOD_NAME(level, filename=None):
    """
    inputs:
        level: one of 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'
        filename: logging destination
    Returns a logging.FileHandler object
    """
    if filename is None:
        if NERSC_LOG_DIRECTORY.exists() and NERSC_LOG_DIRECTORY.is_dir():
            filename = NERSC_LOG_DIRECTORY / f"{getpass.getuser()}.log"
        else:
            filename = "metatlas.log"
    file_formatter = logging.Formatter("%(asctime)s;%(levelname)s;%(name)s;%(message)s")
    file_handler = logging.FileHandler(filename)
    file_handler.setFormatter(file_formatter)
    file_handler.setLevel(levels[level])
    return file_handler