diff --git a/dvc/repo/__init__.py b/dvc/repo/__init__.py index 166cc13af7..88618cf49e 100644 --- a/dvc/repo/__init__.py +++ b/dvc/repo/__init__.py @@ -1,4 +1,3 @@ -import logging import os from contextlib import contextmanager from functools import wraps @@ -435,8 +434,7 @@ def _collect_stages(self): for file_name in filter(is_valid_filename, files): path = os.path.join(root, file_name) stage_loader = Dvcfile(self, path).stages - with stage_loader.log_level(at=logging.DEBUG): - stages.extend(stage_loader.values()) + stages.extend(stage_loader.values()) outs.update( out.fspath for stage in stages diff --git a/dvc/stage/__init__.py b/dvc/stage/__init__.py index a1101f0715..fe96f272e8 100644 --- a/dvc/stage/__init__.py +++ b/dvc/stage/__init__.py @@ -246,13 +246,13 @@ def _changed_outs(self): def stage_changed(self, warn=False): changed = self.md5 != self._compute_md5() if changed and warn: - logger.warning("DVC-file '{}' changed.".format(self.relpath)) + logger.debug("DVC-file '{}' changed.".format(self.relpath)) return changed @rwlocked(read=["deps", "outs"]) def changed(self): if self._changed(): - logger.warning("{} changed.".format(self)) + logger.debug("{} changed.".format(self)) return True logger.debug("{} didn't change.".format(self)) @@ -831,5 +831,5 @@ def stage_status(self): def stage_changed(self, warn=False): if self.cmd_changed and warn: - logger.warning("'cmd' of {} has changed.".format(self)) + logger.debug("'cmd' of {} has changed.".format(self)) return self.cmd_changed diff --git a/dvc/stage/loader.py b/dvc/stage/loader.py index 05fa6300b9..0f5680c0b2 100644 --- a/dvc/stage/loader.py +++ b/dvc/stage/loader.py @@ -1,7 +1,6 @@ import logging import os from collections import Mapping, defaultdict -from contextlib import contextmanager from copy import deepcopy from itertools import chain @@ -30,14 +29,6 @@ def __init__(self, dvcfile, stages_data, lockfile_data=None): self.dvcfile = dvcfile self.stages_data = stages_data or {} self.lockfile_data = lockfile_data or {} - self._log_level = logging.WARNING - - @contextmanager - def log_level(self, at): - """Change log_level temporarily for StageLoader.""" - self._log_level, level = at, self._log_level - yield - self._log_level = level def filter(self, item=None): if not item: @@ -154,11 +145,8 @@ def __getitem__(self, name): raise StageNotFound(self.dvcfile, name) if not self.lockfile_data.get(name): - logger.log( - self._log_level, - "No lock entry found for '%s:%s'", - self.dvcfile.relpath, - name, + logger.debug( + "No lock entry found for '%s:%s'", self.dvcfile.relpath, name, ) return self.load_stage( @@ -187,11 +175,6 @@ def __init__(self, dvcfile, stage_data, stage_text=None): def filter(self, item=None): return self - @contextmanager - def log_level(self, *args, **kwargs): - """No-op context manager.""" - yield - def __getitem__(self, item): if item: logger.warning(