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)