diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 867ef4ebc7600a..2de1008e83fb3f 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -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): """ @@ -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.