发版v0.3

This commit is contained in:
li-xiaochen 2024-12-08 20:46:44 +08:00
parent 383bed2a9d
commit 00212e447b
2 changed files with 8 additions and 5 deletions

View file

@ -19,7 +19,7 @@ mimetypes.add_type("text/html", ".html")
mimetypes.add_type("text/css", ".css") mimetypes.add_type("text/css", ".css")
mimetypes.add_type("application/javascript", ".js") mimetypes.add_type("application/javascript", ".js")
version = "v0.2" version = "v0.3"
get_new_version_url = ( get_new_version_url = (
"https://git.zhaozuohong.vip/api/v1/repos/mower-ng/launcher/releases/latest" "https://git.zhaozuohong.vip/api/v1/repos/mower-ng/launcher/releases/latest"
@ -144,7 +144,7 @@ class Api:
universal_newlines=False universal_newlines=False
) as p: ) as p:
stdout_thread = threading.Thread(target=read_stream, args=(p.stdout, logger.info)) stdout_thread = threading.Thread(target=read_stream, args=(p.stdout, logger.info))
stderr_thread = threading.Thread(target=read_stream, args=(p.stderr, logger.error)) stderr_thread = threading.Thread(target=read_stream, args=(p.stderr, logger.info))
stdout_thread.start() stdout_thread.start()
stderr_thread.start() stderr_thread.start()

9
log.py
View file

@ -2,18 +2,21 @@ import logging
from logging.handlers import RotatingFileHandler from logging.handlers import RotatingFileHandler
log_level = logging.ERROR
# 配置日志 # 配置日志
def setup_logger(): def setup_logger():
logger = logging.getLogger("launcher.log") logger = logging.getLogger("launcher.log")
logger.setLevel(logging.DEBUG) logger.setLevel(log_level)
# 控制台输出 # 控制台输出
console_handler = logging.StreamHandler() console_handler = logging.StreamHandler()
console_handler.setLevel(logging.DEBUG) console_handler.setLevel(log_level)
# 文件输出 # 文件输出
file_handler = RotatingFileHandler( file_handler = RotatingFileHandler(
"launcher.log", maxBytes=5 * 1024 * 1024, backupCount=3 "launcher.log", maxBytes=5 * 1024 * 1024, backupCount=3, encoding='utf-8'
) )
file_handler.setLevel(logging.INFO) file_handler.setLevel(logging.INFO)