diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-27 14:40:06 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-27 14:40:06 (GMT) |
commit | 2353e35570ba5432cc1335c3926f8e5118c6404e (patch) | |
tree | 770ba4672c9e8777bfd6c7d07a9c15f666cb8ecb /Lib/logging/handlers.py | |
parent | 345a5d735706a9ab41f1a682ed34815086970bb0 (diff) | |
download | cpython-2353e35570ba5432cc1335c3926f8e5118c6404e.zip cpython-2353e35570ba5432cc1335c3926f8e5118c6404e.tar.gz cpython-2353e35570ba5432cc1335c3926f8e5118c6404e.tar.bz2 |
Closes #12419: Added ident to SysLogHandler.
Diffstat (limited to 'Lib/logging/handlers.py')
-rw-r--r-- | Lib/logging/handlers.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 5779a7d..ef17081 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -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' """ |