simplify encodings

This commit is contained in:
Alan Hamlett 2013-12-03 02:36:52 +01:00
parent d714bb9299
commit 9ca3ac3e49
1 changed files with 2 additions and 5 deletions

View File

@ -38,18 +38,15 @@ class CustomEncoder(json.JSONEncoder):
class JsonFormatter(logging.Formatter):
def setup(self, timestamp, isWrite, targetFile, version, plugin):
encoding = sys.getfilesystemencoding()
self.timestamp = timestamp
self.isWrite = isWrite
self.targetFile = targetFile.decode(encoding, 'ignore')
self.targetFile = targetFile
self.version = version
self.plugin = plugin
def format(self, record):
now = self.formatTime(record, self.datefmt).decode('utf-8', 'ignore')
data = OrderedDict([
('now', now),
('now', self.formatTime(record, self.datefmt)),
('version', self.version),
('plugin', self.plugin),
('time', self.timestamp),