mirror of
https://github.com/python/cpython.git
synced 2026-01-31 07:05:24 +00:00
Issue #7077: logging: SysLogHandler now treats Unicode as per RFC 5424.
This commit is contained in:
parent
ff8c1e5ace
commit
42ead48dc1
@ -779,6 +779,10 @@ class SysLogHandler(logging.Handler):
|
||||
self.encodePriority(self.facility,
|
||||
self.mapPriority(record.levelname)),
|
||||
msg)
|
||||
#Message is a string. Convert to bytes as required by RFC 5424
|
||||
msg = msg.encode('utf-8')
|
||||
if codecs:
|
||||
msg = codecs.BOM_UTF8 + msg
|
||||
try:
|
||||
if self.unixsocket:
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user