From 64eafb98f988818de423e91f662817cf2b94942f Mon Sep 17 00:00:00 2001 From: Thomas B Thompson Date: Fri, 24 Dec 2010 03:18:43 -0500 Subject: done with logging stuff -- pretty simple, just need to import from logger module and then run something like "main_log.debug("text")" --- logger/UTF8LogFormatter.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 logger/UTF8LogFormatter.py (limited to 'logger/UTF8LogFormatter.py') 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') -- cgit v1.2.3