Skip to content

Commit

Permalink
#
Browse files Browse the repository at this point in the history
  • Loading branch information
yutiansut committed Jan 7, 2019
1 parent 2aa38bf commit f62349a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@
- [1.0.25](#1025)

<!-- /TOC -->
## 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
Expand Down
23 changes: 14 additions & 9 deletions QUANTAXIS/QAUtil/QALogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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
Expand All @@ -110,19 +115,19 @@ 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)

if ui_progress is not None and ui_progress_int_value is not None:
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
Expand Down
2 changes: 1 addition & 1 deletion QUANTAXIS/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
2017/4/8
"""

__version__ = '1.2.6.dev1'
__version__ = '1.2.6'
__author__ = 'yutiansut'
logo = ' \n \
```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` \n \
Expand Down

0 comments on commit f62349a

Please sign in to comment.