utils.py 文件源码

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

项目:LoLVRSpectate 作者: Fire-Proof 项目源码 文件源码
def setup_logging(debug=False, os_info=True):
    if os.environ.get("LOLVRSPECTATE_DEBUG") == "1":
        debug = True

    if not debug:
        format_ = '%(asctime)-15s || %(message)s'
        logging.basicConfig(filename="LoLVRSpectate.log", format=format_, level=logging.INFO, filemode="w")
        logging.getLogger().addHandler(logging.StreamHandler())  # Log both to file and console
    else:
        logging.basicConfig(level=logging.DEBUG)

    if os_info:
        logging.info("Win platform = {}".format(platform.platform()))
        if 'PROGRAMFILES(X86)' in os.environ:
            logging.info("System Arch = {}".format("64 bit"))
        else:
            logging.info("System Arch = {}".format("32 bit"))
        logging.info("Python version = {}".format(sys.version))
        logging.info("VorpX exclusion = {}".format(is_excluded()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号