From: Zac Medico Date: Fri, 6 Nov 2009 02:56:32 +0000 (-0000) Subject: Use writemsg instead of print, to send debug messages to stderr. X-Git-Tag: v2.2_rc49~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=883f1ba5971f6b62b66ac3e06caff47c10b0b786;p=portage.git Use writemsg instead of print, to send debug messages to stderr. svn path=/main/trunk/; revision=14779 --- diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index e5cb10f7b..b78726258 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -1193,10 +1193,12 @@ class depgraph(object): strict = pkg.type_name != "installed" if debug: - print() - print("Parent: ", pkg) - print("Depstring:", dep_string) - print("Priority:", dep_priority) + writemsg_level("\nParent: %s\n" % (pkg,), + noiselevel=-1, level=logging.DEBUG) + writemsg_level("Depstring: %s\n" % (dep_string,), + noiselevel=-1, level=logging.DEBUG) + writemsg_level("Priority: %s\n" % (dep_priority,), + noiselevel=-1, level=logging.DEBUG) try: selected_atoms = self._select_atoms(dep_root, @@ -1210,7 +1212,9 @@ class depgraph(object): return 0 if debug: - print("Candidates:", [str(x) for x in selected_atoms[pkg]]) + writemsg_level("Candidates: %s\n" % \ + ([str(x) for x in selected_atoms[pkg]],), + noiselevel=-1, level=logging.DEBUG) root_config = self._frozen_config.roots[dep_root] vardb = root_config.trees["vartree"].dbapi @@ -1238,8 +1242,9 @@ class depgraph(object): for virt_pkg, atoms in selected_atoms.items(): if debug: - print("Candidates: %s: %s" % \ - (virt_pkg.cpv, [str(x) for x in atoms])) + writemsg_level("Candidates: %s: %s\n" % \ + (virt_pkg.cpv, [str(x) for x in atoms]), + noiselevel=-1, level=logging.DEBUG) # Just assume depth + 1 here for now, though it's not entirely # accurate since multilple levels of indirect virtual deps may