changeset 15:68a9b24a182a draft

encode log messages in UTF8 before passing them to syslog Signed-off-by: Changaco <changaco ατ changaco δοτ net>
author Changaco <changaco ατ changaco δοτ net>
date Tue, 24 Apr 2012 00:30:31 +0200
parents 5c26fc1adbac
children 183f4f544987
files feed-push
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/feed-push
+++ b/feed-push
@@ -62,8 +62,10 @@ def log(*args):
     priority = 7 - priority
     if priority < global_args.log_level:
         return
+    if isinstance(msg, unicode):
+        msg = msg.encode('utf8')
     if global_args.syslog:
-        syslog(*args)
+        syslog(priority, msg)
     else:
         sys.stderr.write(log_levels[priority]+': '+msg+'\n')