From 31784f32b6057309c3ddcc724674876ab42dc322 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Sat, 17 Nov 2018 22:21:35 +0800 Subject: [PATCH] =?UTF-8?q?[Add]=E5=B0=86=E6=97=A5=E5=BF=97=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=94=B9=E4=B8=BAUTF8=E7=BC=96=E7=A0=81=EF=BC=8CClose?= =?UTF-8?q?=20#1248?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/vtEngine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnpy/trader/vtEngine.py b/vnpy/trader/vtEngine.py index 63499977..ee683840 100644 --- a/vnpy/trader/vtEngine.py +++ b/vnpy/trader/vtEngine.py @@ -700,7 +700,7 @@ class LogEngine(object): if not filename: filename = 'vt_' + datetime.now().strftime('%Y%m%d') + '.log' filepath = getTempPath(filename) - self.fileHandler = logging.FileHandler(filepath) + self.fileHandler = logging.FileHandler(filepath, mode='w', encoding='utf-8') self.fileHandler.setLevel(self.level) self.fileHandler.setFormatter(self.formatter) self.logger.addHandler(self.fileHandler)