From f1850175cc5294651b579ed7c9462e4bd651f683 Mon Sep 17 00:00:00 2001 From: msincenselee Date: Mon, 15 Jan 2018 19:54:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=86=99=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/vtEngine.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vnpy/trader/vtEngine.py b/vnpy/trader/vtEngine.py index 00d79956..cdbd66c1 100644 --- a/vnpy/trader/vtEngine.py +++ b/vnpy/trader/vtEngine.py @@ -4,7 +4,7 @@ print 'load vtEngine.py' import shelve from collections import OrderedDict - +import os from pymongo import MongoClient from pymongo.errors import ConnectionFailure @@ -17,7 +17,7 @@ from vnpy.trader.language import text from vnpy.trader.vtFunction import loadMongoSetting from vnpy.trader.vtGateway import * from vnpy.trader.app import (ctaStrategy, riskManager) -from vnpy.trader.setup_logger import get_logger +from vnpy.trader.setup_logger import get_logger,setup_logger import psutil try: @@ -286,7 +286,9 @@ class MainEngine(object): if self.logger is not None: self.logger.info(content) else: - self.logger = get_logger() + filename = os.path.abspath(os.path.join(os.path.dirname(__file__), 'logs', 'vnpy')) + self.logger = setup_logger( filename=filename, name='vnpy') + # ---------------------------------------------------------------------- def writeError(self, content):