utils.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:py-google-auth 作者: HashGrowth 项目源码 文件源码
def log_error(step, content):
    '''
    This function logs a page for error.
    It is called whenever an unhandled exception will occur.
    `step`: The step in login process, it could be normal_login, step_two_login or
    select_alternate.
            It makes it easy to identify the file in logs.
    `content`: content to log.
    '''
    file_name = step + "- " + time.strftime("%d-%m-%Y %H-%M-%S") + ".html"
    f = open(log_dir+file_name, 'w')
    f.write(content)
    f.close()

    # hostname of the machine where the py-google-auth is running
    hostname = platform.node()

    return file_name, hostname
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号