import json


def parseEnvLog(envLog):
    """
    Parse env log file

    Parameters
    ----------
    envLog : str
        Env lof file path.

    Returns
    -------
    sysInfo : dict
        system information .
    progList : dict
        programs used.

    """
    #parse the env log
    with open(envLog) as f:
        envdata=f.read().splitlines()
    
    sysInfo={}
    progList={}
    for l in envdata:
        if not l.startswith("#"):
            if not sysInfo:
                sysInfo=json.loads(l)
            else:
                thisProgram=json.loads(l)
                if 'name' in thisProgram:
                    progList[thisProgram['name']]=thisProgram
    return sysInfo,progList