From 172f45208f7e12be43e7bce57230fe72b06ecfd0 Mon Sep 17 00:00:00 2001 From: snowy Date: Mon, 25 Mar 2024 00:33:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20require()=E6=8F=92=E4=BB=B6=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/utils/data.py | 1 + liteyuki/utils/log.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/liteyuki/utils/data.py b/liteyuki/utils/data.py index 4ae3d2fe..cb825f75 100644 --- a/liteyuki/utils/data.py +++ b/liteyuki/utils/data.py @@ -217,6 +217,7 @@ class Database(BaseORMAdapter): """扁平化数据,返回扁平化对象 Args: + data: 数据,可迭代对象 Returns: json字符串 diff --git a/liteyuki/utils/log.py b/liteyuki/utils/log.py index af18f821..d098999a 100644 --- a/liteyuki/utils/log.py +++ b/liteyuki/utils/log.py @@ -2,7 +2,7 @@ import sys import loguru from typing import TYPE_CHECKING from .config import load_from_yaml -from .language import Language, get_default_lang +from .language import Language, get_default_lang, get_system_lang_code logger = loguru.logger if TYPE_CHECKING: @@ -59,7 +59,7 @@ def init_log(): format=get_format(config.get("log_level", "INFO")), ) show_icon = config.get("log_icon", True) - lang = Language(config.get("default_language", "en")) + lang = Language(config.get("default_language", get_system_lang_code())) debug = lang.get('log.debug', default="==DEBUG") info = lang.get('log.info', default="===INFO")