diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-09 15:55:23 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-09 15:55:23 (GMT) |
commit | 8dd8d582e3c6d1dd80f5b958284fcb7260209bf3 (patch) | |
tree | 9ce41344611954ba7b0c3ad9277fa19041f6cbf1 /Lib/logging | |
parent | d9463b233c5fefbda3f1b9f2b37f7ff78a7c88ff (diff) | |
parent | 8168d10ea683d939ae52a1ed3d7c697c92bfae3d (diff) | |
download | cpython-8dd8d582e3c6d1dd80f5b958284fcb7260209bf3.zip cpython-8dd8d582e3c6d1dd80f5b958284fcb7260209bf3.tar.gz cpython-8dd8d582e3c6d1dd80f5b958284fcb7260209bf3.tar.bz2 |
Merged fix for issue #12168 from 3.2.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/handlers.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index f17db0e..5779a7d 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -769,6 +769,8 @@ class SysLogHandler(logging.Handler): """ return self.priority_map.get(levelName, "warning") + append_nul = True # some old syslog daemons expect a NUL terminator + def emit(self, record): """ Emit a record. @@ -776,7 +778,9 @@ class SysLogHandler(logging.Handler): The record is formatted, and then sent to the syslog server. If exception information is present, it is NOT sent to the server. """ - msg = self.format(record) + '\000' + msg = self.format(record) + if self.append_nul: + msg += '\000' """ We need to convert record level to lowercase, maybe this will change in the future. |