def waitAndLogResultOfCmdProcess(process, logFile, processStartTime=None):
    (exitcode, output, error) = waitResultOfCmdProcess(process)

    if logFile is not None:
        newlines = getNewLineSeperator()
        with open(logFile, "w") as f:
            f.write("---process id: %d" % process.pid)
            f.write(newlines)

            if processStartTime is not None:
                f.write("---started at: %s" % processStartTime)
                f.write(newlines)

            f.write("---ended at: %s" % datetime.now())
            f.write(newlines)

            f.write("---exit code: %d" % exitcode)
            f.write(newlines)

            f.write("---error message: ")
            f.write(newlines)
            f.write(error)
            f.write(newlines)

            f.write("---output message: ")
            f.write(newlines)
            f.write(output)
            f.write(newlines)

            f.close()
    return exitcode
Integration test: try to parse an entire git log from a file
dataset/ETHPy150Open harryliu/edwin/edwinAgent/common/os_helper.py/waitAndLogResultOfCmdProcess--crossover with--dataset/ETHPy150Open tarmstrong/git2json/tests/test_git2json.py/int_test_parse_commits