aboutsummaryrefslogtreecommitdiff
path: root/logger/UTF8LogFormatter.py
diff options
context:
space:
mode:
Diffstat (limited to 'logger/UTF8LogFormatter.py')
-rw-r--r--logger/UTF8LogFormatter.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/logger/UTF8LogFormatter.py b/logger/UTF8LogFormatter.py
new file mode 100644
index 0000000..2d3fae5
--- /dev/null
+++ b/logger/UTF8LogFormatter.py
@@ -0,0 +1,8 @@
+from logging import Formatter
+
+class UTF8LogFormatter(Formatter):
+ def format(self, record):
+ try:
+ return Formatter.format(self, record)
+ except Exception, e:
+ return Formatter.format(self, record).encode('utf8')