From 00212e447b548d5d295960bd3a71f9395678dbf3 Mon Sep 17 00:00:00 2001 From: li-xiaochen <397721316@qq.com> Date: Sun, 8 Dec 2024 20:46:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=89=88v0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- launcher.py | 4 ++-- log.py | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/launcher.py b/launcher.py index ed173e0..eb0af7a 100644 --- a/launcher.py +++ b/launcher.py @@ -19,7 +19,7 @@ mimetypes.add_type("text/html", ".html") mimetypes.add_type("text/css", ".css") mimetypes.add_type("application/javascript", ".js") -version = "v0.2" +version = "v0.3" get_new_version_url = ( "https://git.zhaozuohong.vip/api/v1/repos/mower-ng/launcher/releases/latest" @@ -144,7 +144,7 @@ class Api: universal_newlines=False ) as p: 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() stderr_thread.start() diff --git a/log.py b/log.py index 686d527..79f53a1 100644 --- a/log.py +++ b/log.py @@ -2,18 +2,21 @@ import logging from logging.handlers import RotatingFileHandler +log_level = logging.ERROR + + # 配置日志 def setup_logger(): logger = logging.getLogger("launcher.log") - logger.setLevel(logging.DEBUG) + logger.setLevel(log_level) # 控制台输出 console_handler = logging.StreamHandler() - console_handler.setLevel(logging.DEBUG) + console_handler.setLevel(log_level) # 文件输出 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)