From f62349ab233c7eff9e308291ff35e0f7f199dfae Mon Sep 17 00:00:00 2001 From: yutiansut Date: Tue, 8 Jan 2019 07:45:59 +0800 Subject: [PATCH] # --- CHANGELOG.md | 17 +++++++++++++++++ QUANTAXIS/QAUtil/QALogs.py | 23 ++++++++++++++--------- QUANTAXIS/__init__.py | 2 +- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2f55ec8d..4a1f180ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,23 @@ - [1.0.25](#1025) +## 1.2.6 + +1. 优化QADOCKER文档 +2. 增加QAORDER文档 +3. 优化了QALog模块在打印大量日志的时候无法知道其用途的问题 + +现在的quantaxis log 会以这个模式作为name: +``` + 'quantaxis_{}-{}-.log'.format(get_config(), os.sep, os.path.basename(sys.argv[0]).split('.py')[0], str(datetime.datetime.now().strftime( + '%Y-%m-%d-%H-%M-%S'))) +``` +4. 修改了QAUser的注册模块逻辑 +5. 增加了 QA_DataStruct_Min 和 QA_DataStruct_Day两个基类模型 +6. 修复settle的一个bug + + + ## 1.2.5 1. 对于QA.QA_util_code_tostr 增加 原先为list类型的支持 现在支持自动补全的 int/list/str 类型转 str diff --git a/QUANTAXIS/QAUtil/QALogs.py b/QUANTAXIS/QAUtil/QALogs.py index fda464474..df2b31a57 100755 --- a/QUANTAXIS/QAUtil/QALogs.py +++ b/QUANTAXIS/QAUtil/QALogs.py @@ -35,7 +35,7 @@ import configparser import datetime import os - +import sys from zenlog import logging from QUANTAXIS.QASetting.QALocalize import log_path, setting_path @@ -72,13 +72,18 @@ def get_config(): """2019-01-03 升级到warning级别 不然大量别的代码的log会批量输出出来 """ +try: + _name = '{}{}quantaxis_{}-{}-.log'.format(get_config(), os.sep, os.path.basename(sys.argv[0]).split('.py')[0], str(datetime.datetime.now().strftime( + '%Y-%m-%d-%H-%M-%S'))) +except: + _name = '{}{}quantaxis-{}-.log'.format(get_config(), os.sep, str(datetime.datetime.now().strftime( + '%Y-%m-%d-%H-%M-%S'))) logging.basicConfig(level=logging.WARNING, format='%(asctime)s QUANTAXIS>>> %(message)s', datefmt='%H:%M:%S', - filename='{}{}quantaxis-{}-.log'.format(get_config(), os.sep, str(datetime.datetime.now().strftime( - '%Y-%m-%d-%H-%M-%S'))), + filename=_name, filemode='w', ) console = logging.StreamHandler() @@ -91,7 +96,7 @@ def get_config(): #logging.info('start QUANTAXIS') -def QA_util_log_debug(logs, ui_log = None, ui_progress = None): +def QA_util_log_debug(logs, ui_log=None, ui_progress=None): """ QUANTAXIS Log Module @yutiansut @@ -101,7 +106,7 @@ def QA_util_log_debug(logs, ui_log = None, ui_progress = None): logging.debug(logs) -def QA_util_log_info(logs, ui_log = None, ui_progress = None, ui_progress_int_value = None): +def QA_util_log_info(logs, ui_log=None, ui_progress=None, ui_progress_int_value=None,): """ QUANTAXIS Log Module @yutiansut @@ -110,11 +115,11 @@ def QA_util_log_info(logs, ui_log = None, ui_progress = None, ui_progress_int_va """ logging.warning(logs) - #给GUI使用,更新当前任务到日志和进度 + # 给GUI使用,更新当前任务到日志和进度 if ui_log is not None: - if isinstance(logs, str) : + if isinstance(logs, str): ui_log.emit(logs) - if isinstance(logs, list) : + if isinstance(logs, list): for iStr in logs: ui_log.emit(iStr) @@ -122,7 +127,7 @@ def QA_util_log_info(logs, ui_log = None, ui_progress = None, ui_progress_int_va ui_progress.emit(ui_progress_int_value) -def QA_util_log_expection(logs, ui_log = None, ui_progress = None): +def QA_util_log_expection(logs, ui_log=None, ui_progress=None): """ QUANTAXIS Log Module @yutiansut diff --git a/QUANTAXIS/__init__.py b/QUANTAXIS/__init__.py index 8df1175b5..86bc6219d 100755 --- a/QUANTAXIS/__init__.py +++ b/QUANTAXIS/__init__.py @@ -32,7 +32,7 @@ 2017/4/8 """ -__version__ = '1.2.6.dev1' +__version__ = '1.2.6' __author__ = 'yutiansut' logo = ' \n \ ```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` \n \