From bb678b6842afbd8d2be24e9baddf8cb6a81533f4 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Sat, 2 Dec 2017 23:16:06 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=E5=85=81=E8=AE=B8=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E5=90=8D=E7=A7=B0=20#602?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/vtEngine.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vnpy/trader/vtEngine.py b/vnpy/trader/vtEngine.py index 8d894838..50aeb05d 100644 --- a/vnpy/trader/vtEngine.py +++ b/vnpy/trader/vtEngine.py @@ -594,10 +594,11 @@ class LogEngine(object): self.logger.addHandler(self.consoleHandler) #---------------------------------------------------------------------- - def addFileHandler(self): + def addFileHandler(self, filename=''): """添加文件输出""" if not self.fileHandler: - filename = 'vt_' + datetime.now().strftime('%Y%m%d') + '.log' + if not filename: + filename = 'vt_' + datetime.now().strftime('%Y%m%d') + '.log' filepath = getTempPath(filename) self.fileHandler = logging.FileHandler(filepath) self.fileHandler.setLevel(self.level)