mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Merged fix for issue #12168 from 3.2.
This commit is contained in:
commit
8dd8d582e3
3 changed files with 14 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue