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()))
评论列表
文章目录