diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-01-02 14:45:58 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-01-02 15:16:49 -0800 |
commit | 80703430da413166d4d3f9d444967adaee59c179 (patch) | |
tree | 20762aa12be304c26d1850234bb6b183ea9a1b21 | |
parent | 1225285f62aef9fff6e7bd36c7efda4e990b6468 (diff) | |
download | portage-80703430da413166d4d3f9d444967adaee59c179.tar.gz portage-80703430da413166d4d3f9d444967adaee59c179.tar.bz2 portage-80703430da413166d4d3f9d444967adaee59c179.zip |
mod_syslog: call syslog() once per line
This will fix bug #350379.
-rw-r--r-- | pym/portage/elog/mod_syslog.py | 13 |
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() |