Skip to content

Commit

Permalink
[Add]将日志文件改为UTF8编码,Close vnpy#1248
Browse files Browse the repository at this point in the history
  • Loading branch information
vnpy-dev-01 committed Nov 17, 2018
1 parent 3fee9cb commit 31784f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vnpy/trader/vtEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def addFileHandler(self, filename=''):
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)
Expand Down

0 comments on commit 31784f3

Please sign in to comment.