增加仓库初始化异常保护及设置logging输出配置

This commit is contained in:
fasiondog 2020-08-26 00:34:43 +08:00
parent 428d33417e
commit fbd0ba7d30
2 changed files with 11 additions and 1 deletions

View File

@ -48,6 +48,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)-15s [%(levelname)s] - %(message)s [%(name)s::%(funcName)s]'
)
from .extend import *
from .deprecated import *
from .indicator import *

View File

@ -566,7 +566,10 @@ def get_part_name_list(house=None, part_type=None):
# 初始化仓库
HouseManager().setup_house()
try:
HouseManager().setup_house()
except Exception as e:
self.logger.warning("无法初始化 hikyuu 策略仓库,请检查网络连接! {}".format(e))
__all__ = [
'add_remote_house',