diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-10-10 07:36:39 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-10-10 07:36:39 -0700 |
commit | 1a00bb2a24bed702ab0703540130d19d669191d0 (patch) | |
tree | 2fb9f5746c628531f72d6e1219e0d9243da48926 | |
parent | 8a119ea94ecc6668797e3a1358465ef3733f3a3e (diff) | |
download | portage-1a00bb2a24bed702ab0703540130d19d669191d0.tar.gz portage-1a00bb2a24bed702ab0703540130d19d669191d0.tar.bz2 portage-1a00bb2a24bed702ab0703540130d19d669191d0.zip |
mod_syslog: add newlines for bug #386627
This fixes omission of newlines in syslog messages since commit
ca7bef7821876791a26a5f9df6938f4c77fe571f.
-rw-r--r-- | pym/portage/elog/mod_syslog.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pym/portage/elog/mod_syslog.py b/pym/portage/elog/mod_syslog.py index d71dab4f1..79b11a68c 100644 --- a/pym/portage/elog/mod_syslog.py +++ b/pym/portage/elog/mod_syslog.py @@ -1,5 +1,5 @@ # elog/mod_syslog.py - elog dispatch module -# Copyright 2006-2007 Gentoo Foundation +# Copyright 2006-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import sys @@ -21,12 +21,11 @@ def process(mysettings, key, logentries, fulltext): if not phase in logentries: continue for msgtype,msgcontent in logentries[phase]: - msgtext = "".join(msgcontent) - for line in msgtext.splitlines(): + for line in msgcontent: line = "%s: %s: %s" % (key, phase, line) - if sys.hexversion < 0x3000000 and isinstance(msgtext, unicode): + if sys.hexversion < 0x3000000 and isinstance(line, unicode): # Avoid TypeError from syslog.syslog() line = line.encode(_encodings['content'], 'backslashreplace') - syslog.syslog(_pri[msgtype], line) + syslog.syslog(_pri[msgtype], line.rstrip("\n")) syslog.closelog() |