修复 log 文件不会自动创建
This commit is contained in:
@@ -97,6 +97,7 @@ class App:
|
||||
def check_data_dir_exists():
|
||||
os.makedirs(Config().QUERY_DATA_DIR, exist_ok=True)
|
||||
os.makedirs(Config().USER_DATA_DIR, exist_ok=True)
|
||||
touch_file(Config().OUT_PUT_LOG_TO_FILE_PATH)
|
||||
|
||||
@classmethod
|
||||
def test_send_notifications(cls):
|
||||
|
||||
@@ -105,6 +105,10 @@ def get_file_total_line_num(file, encoding='utf-8'):
|
||||
return len(f.readlines())
|
||||
|
||||
|
||||
def touch_file(path):
|
||||
with open(path, 'a'): pass
|
||||
|
||||
|
||||
def pick_file_lines(file, lines):
|
||||
return [x for i, x in enumerate(file) if i in lines]
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class CommonLog(BaseLog):
|
||||
MESSAGE_SEND_PUSH_BEAR_SUCCESS = '发送成功,请检查微信'
|
||||
MESSAGE_SEND_PUSH_BEAR_FAIL = 'PushBear发送失败,请检查KEY'
|
||||
|
||||
MESSAGE_OUTPUT_TO_FILE_IS_UN_ENABLE = '请先打开配置:输出到文件'
|
||||
MESSAGE_OUTPUT_TO_FILE_IS_UN_ENABLE = '请先打开配置项中的:OUT_PUT_LOG_TO_FILE_ENABLED ( 输出到文件 )'
|
||||
|
||||
MESSAGE_GET_RESPONSE_FROM_FREE_AUTO_CODE = '从免费打码获取结果失败'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user