mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Closes #12419: Added ident to SysLogHandler.
This commit is contained in:
parent
345a5d7357
commit
2353e35570
3 changed files with 17 additions and 0 deletions
|
@ -769,6 +769,7 @@ class SysLogHandler(logging.Handler):
|
|||
"""
|
||||
return self.priority_map.get(levelName, "warning")
|
||||
|
||||
ident = '' # prepended to all messages
|
||||
append_nul = True # some old syslog daemons expect a NUL terminator
|
||||
|
||||
def emit(self, record):
|
||||
|
@ -779,6 +780,8 @@ class SysLogHandler(logging.Handler):
|
|||
exception information is present, it is NOT sent to the server.
|
||||
"""
|
||||
msg = self.format(record)
|
||||
if self.ident:
|
||||
msg = self.ident + msg
|
||||
if self.append_nul:
|
||||
msg += '\000'
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue