summaryrefslogtreecommitdiff
path: root/python2
diff options
context:
space:
mode:
authorSebastien Martini <seb@dbzteam.org>2011-11-17 11:58:10 +0100
committerSebastien Martini <seb@dbzteam.org>2011-11-17 11:58:10 +0100
commit6bee47701efa5613605988af10593a3c69682ba3 (patch)
tree27d27c767fa8be3ef4a8ebe74ae70335ddebd0aa /python2
parentb55d650cb709cf6487320e90899ad809814b28ed (diff)
downloadpyinotify-6bee47701efa5613605988af10593a3c69682ba3.tar.gz
Removed customized unicode logger class.
It should be fine without it, pyinotify shouldn't have unicode instances left internally.
Diffstat (limited to 'python2')
-rwxr-xr-xpython2/pyinotify.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/python2/pyinotify.py b/python2/pyinotify.py
index 5f366d7..27f0f4e 100755
--- a/python2/pyinotify.py
+++ b/python2/pyinotify.py
@@ -259,45 +259,9 @@ class _PyinotifyLogger(logging.getLoggerClass()):
return rv
-class _UnicodeLogRecord(logging.LogRecord):
- def __init__(self, name, level, pathname, lineno,
- msg, args, exc_info, func=None):
- py_version = sys.version_info
- # func argument was added in Python 2.5, just ignore it otherwise.
- if py_version[0] >= 2 and py_version[1] >= 5:
- logging.LogRecord.__init__(self, name, level, pathname, lineno,
- msg, args, exc_info, func)
- else:
- logging.LogRecord.__init__(self, name, level, pathname, lineno,
- msg, args, exc_info)
-
- def getMessage(self):
- msg = self.msg
- if not isinstance(msg, (unicode, str)):
- try:
- msg = str(self.msg)
- except UnicodeError:
- pass
- if self.args:
- if isinstance(self.args, tuple):
- def str_to_unicode(s):
- """Return unicode string."""
- if not isinstance(s, str):
- return s
- return unicode(s, sys.getfilesystemencoding())
- args = tuple([str_to_unicode(m) for m in self.args])
- else:
- args = self.args
- msg = msg % args
- if not isinstance(msg, unicode):
- msg = unicode(msg, sys.getfilesystemencoding())
- return msg
-
-
# Logging
def logger_init():
"""Initialize logger instance."""
- logging.setLoggerClass(_PyinotifyLogger)
log = logging.getLogger("pyinotify")
console_handler = logging.StreamHandler()
console_handler.setFormatter(