diff options
author | Thomas B Thompson <tbent@spice.(none)> | 2010-12-24 03:18:43 -0500 |
---|---|---|
committer | Thomas B Thompson <tbent@spice.(none)> | 2010-12-24 03:23:26 -0500 |
commit | 64eafb98f988818de423e91f662817cf2b94942f (patch) | |
tree | 5ce876dc64131cf0fc405a0d0bd1f1027b57d9fe /logger/UTF8LogFormatter.py | |
parent | 8cecf83f16fcdec5b3ee68cc40c2b360e0f845d0 (diff) |
done with logging stuff -- pretty simple, just need to import from logger module and then run something like "main_log.debug("text")"
Diffstat (limited to 'logger/UTF8LogFormatter.py')
-rw-r--r-- | logger/UTF8LogFormatter.py | 8 |
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') |