Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Lib/logging/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,8 @@ def mapPriority(self, levelName):
"""
return self.priority_map.get(levelName, "warning")

ident = '' # prepended to all messages
append_nul = True # some old syslog daemons expect a NUL terminator
ident = '' # prepended to all messages
message_separator_character = '\000' # some old syslog daemons expect a NUL terminator

def emit(self, record):
"""
Expand All @@ -934,11 +934,9 @@ def emit(self, record):
exception information is present, it is NOT sent to the server.
"""
try:
msg = self.format(record)
msg = self.format(record) + message_separator_character
if self.ident:
msg = self.ident + msg
if self.append_nul:
msg += '\000'

# We need to convert record level to lowercase, maybe this will
# change in the future.
Expand Down