From 888829544a19ac9821bc0076e163c5c6a56ad5e8 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 22 Jun 2018 04:43:46 +0100 Subject: [PATCH] issue #280: move find_module() log output to IOLOG It just generates far too much spam, and its final decision is obvious since a followup load_module() will exist for positive matches. --- mitogen/core.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mitogen/core.py b/mitogen/core.py index ebd41f84..bfe33dec 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -623,7 +623,7 @@ class Importer(object): fullname = fullname.rstrip('.') try: pkgname, dot, _ = fullname.rpartition('.') - _v and LOG.debug('%r.find_module(%r)', self, fullname) + _vv and IOLOG.debug('%r.find_module(%r)', self, fullname) suffix = fullname[len(pkgname+dot):] if suffix not in self._present.get(pkgname, (suffix,)): _v and LOG.debug('%r: master doesn\'t know %r', self, fullname) @@ -631,8 +631,10 @@ class Importer(object): pkg = sys.modules.get(pkgname) if pkg and getattr(pkg, '__loader__', None) is not self: - _v and LOG.debug('%r: %r is submodule of a package we did not load', - self, fullname) + _vv and IOLOG.debug( + '%r: %r is submodule of a package we did not load', + self, fullname + ) return None # #114: explicitly whitelisted prefixes override any @@ -643,9 +645,10 @@ class Importer(object): try: self.builtin_find_module(fullname) - _v and LOG.debug('%r: %r is available locally', self, fullname) + _vv and IOLOG.debug('%r: %r is available locally', + self, fullname) except ImportError: - _v and LOG.debug('find_module(%r) returning self', fullname) + _vv and IOLOG.debug('find_module(%r) returning self', fullname) return self finally: del _tls.running