from pathlib import Path


def setLogFile(logFileName):
    """
    Setup logging file

    Arguments:
        logFileName {str} -- name of log file

    Returns:
        Pathlib.Path -- Pathlib object logfile
    """

    if not logFileName:
        return None

    lFile = Path(logFileName)

    if Path(lFile.parent).is_dir():
        lFile.touch(exist_ok=True)
    else:
        # cannot create log file
        # on command line
        lFile = Path("commandLog.txt")
        lFile.touch(exist_ok=True)

    return lFile