Permalink
Browse files

use the actual logging framework instead of rolling our own

  • Loading branch information...
ejucovy committed Dec 2, 2013
1 parent 243ae8d commit 662d2d916a0e32f2d338c9abc43cad410c2fdcf8
Showing with 8 additions and 8 deletions.
  1. +4 −4 multireposearch/search.py
  2. +4 −4 multireposearch/sqlindexer.py
@@ -23,10 +23,10 @@ class MultiRepoSearchPlugin(Component):
"Name of the component implementing `IMultiRepoSearchBackend`, "
"which implements repository indexing and search strategies.")
- def reindex_all(self, verbose=False):
+ def reindex_all(self):
repos = RepositoryManager(self.env).get_all_repositories()
for reponame in repos:
- self.search_backend.reindex_repository(reponame, verbose=verbose)
+ self.search_backend.reindex_repository(reponame)
## methods for IRepositoryChangeListener
def changeset_added(self, repos, changeset):
@@ -70,10 +70,10 @@ def get_admin_commands(self):
return [
('multireposearch reindex_all', '', 'reindex all known repositories',
None,
- lambda: self.reindex_all(verbose=True)),
+ lambda: self.reindex_all()),
('multireposearch reindex', 'reponame', 'reindex a single repository',
None,
- lambda reponame: self.search_backend.reindex_repository(reponame, verbose=True)),
+ lambda reponame: self.search_backend.reindex_repository(reponame)),
]
@@ -40,15 +40,15 @@ def _walk_repo(self, repo, path):
## methods for IMultiRepoSearchBackend
- def reindex_repository(self, reponame, verbose=False, modified=None):
+ def reindex_repository(self, reponame, modified=None):
repo = self.env.get_repository(reponame=reponame)
last_known_rev = self._last_known_rev(reponame)
if last_known_rev is not None and last_known_rev == repo.youngest_rev:
- if verbose: print "Repo %s doesn't need reindexing" % reponame
+ self.log.debug("Repo %s doesn't need reindexing" % reponame)
return
- if verbose: print "Repo %s DOES need reindexing" % reponame
+ self.log.debug("Repo %s DOES need reindexing" % reponame)
mimeview = Mimeview(self.env)
@self.env.with_transaction()
@@ -61,7 +61,7 @@ def do_reindex(db):
iterator = (repo.get_node(path) for path in modified)
for node in iterator:
- if verbose: print "Fetching content at %s" % node.path
+ self.log.debug("Fetching content at %s" % node.path)
content = node.get_content()
if content is None:
continue

0 comments on commit 662d2d9

Please sign in to comment.