summaryrefslogtreecommitdiffstats
path: root/pym/elog_modules
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-21 05:00:59 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-21 05:00:59 +0000
commit0af6c6ee182e58a23e1c26c9fd577f3b83a0418d (patch)
tree3b4307b3eda8ab57989536c85b20cbd66d80eddb /pym/elog_modules
parent357eb4f65a5c315d8e43eb0493f02db03b2b20d7 (diff)
downloadportage-0af6c6ee182e58a23e1c26c9fd577f3b83a0418d.tar.gz
portage-0af6c6ee182e58a23e1c26c9fd577f3b83a0418d.tar.bz2
portage-0af6c6ee182e58a23e1c26c9fd577f3b83a0418d.zip
add new echo module for people who don't want any real logging (trunk r6458)
svn path=/main/branches/2.1.2/; revision=6899
Diffstat (limited to 'pym/elog_modules')
-rw-r--r--pym/elog_modules/mod_echo.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/pym/elog_modules/mod_echo.py b/pym/elog_modules/mod_echo.py
new file mode 100644
index 000000000..a120d17c9
--- /dev/null
+++ b/pym/elog_modules/mod_echo.py
@@ -0,0 +1,30 @@
+# elog_modules/mod_echo.py - elog dispatch module
+# Copyright 2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+from output import EOutput
+from portage_const import EBUILD_PHASES
+
+_items = {}
+def process(mysettings, key, logentries, fulltext):
+ _items[key] = logentries
+
+def finalize(mysettings):
+ printer = EOutput()
+ for key in _items.keys():
+ print
+ printer.einfo("Messages for package %s:" % key)
+ print
+ for phase in EBUILD_PHASES:
+ if not phase in _items[key]:
+ continue
+ for msgtype, msgcontent in _items[key][phase]:
+ fmap = {"INFO": printer.einfo,
+ "WARN": printer.ewarn,
+ "ERROR": printer.eerror,
+ "LOG": printer.einfo,
+ "QA": printer.ewarn}
+ for line in msgcontent:
+ fmap[msgtype](line.strip("\n"))
+ return