From: Zac Medico Date: Sun, 2 Jan 2011 22:45:58 +0000 (-0800) Subject: mod_syslog: call syslog() once per line X-Git-Tag: v2.2.0_alpha12~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4a6cfadfde21bdd5a0e67348ef66429f9683c485;p=portage.git mod_syslog: call syslog() once per line This will fix bug #350379. --- diff --git a/pym/portage/elog/mod_syslog.py b/pym/portage/elog/mod_syslog.py index d385255b2..d71dab4f1 100644 --- a/pym/portage/elog/mod_syslog.py +++ b/pym/portage/elog/mod_syslog.py @@ -22,10 +22,11 @@ def process(mysettings, key, logentries, fulltext): continue for msgtype,msgcontent in logentries[phase]: msgtext = "".join(msgcontent) - msgtext = "%s: %s: %s" % (key, phase, msgtext) - if sys.hexversion < 0x3000000 and isinstance(msgtext, unicode): - # Avoid TypeError from syslog.syslog() - msgtext = msgtext.encode(_encodings['content'], - 'backslashreplace') - syslog.syslog(_pri[msgtype], msgtext) + for line in msgtext.splitlines(): + line = "%s: %s: %s" % (key, phase, line) + if sys.hexversion < 0x3000000 and isinstance(msgtext, unicode): + # Avoid TypeError from syslog.syslog() + line = line.encode(_encodings['content'], + 'backslashreplace') + syslog.syslog(_pri[msgtype], line) syslog.closelog()