summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-01-02 14:45:58 -0800
committerZac Medico <zmedico@gentoo.org>2011-01-02 14:45:58 -0800
commit4a6cfadfde21bdd5a0e67348ef66429f9683c485 (patch)
tree3d7c06697fdcdb032b7f733ffec1193b0692ff7e
parentb7de3d1fb10e40b4ef03462f8a145968689ac587 (diff)
downloadportage-4a6cfadfde21bdd5a0e67348ef66429f9683c485.tar.gz
portage-4a6cfadfde21bdd5a0e67348ef66429f9683c485.tar.bz2
portage-4a6cfadfde21bdd5a0e67348ef66429f9683c485.zip
mod_syslog: call syslog() once per line
This will fix bug #350379.
-rw-r--r--pym/portage/elog/mod_syslog.py13
1 files changed, 7 insertions, 6 deletions
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()