diff options
author | Adam Spiers <git@adamspiers.org> | 2016-06-29 14:47:07 +0100 |
---|---|---|
committer | Adam Spiers <git@adamspiers.org> | 2018-05-15 13:42:16 +0100 |
commit | 1385b3698a3b230368a3ad8510d2706c0930dc26 (patch) | |
tree | f1db578ab9872b605fa2dfc93936616987089686 /git_deps/detector.py | |
parent | 365dabcd8ee2cd3a18e0ce6066867d479cb60b83 (diff) | |
download | git-deps-1385b3698a3b230368a3ad8510d2706c0930dc26.tar.gz |
move debug logger setup to utils.py
This is cleaner and will allow it to be reused elsewhere.
Diffstat (limited to 'git_deps/detector.py')
-rw-r--r-- | git_deps/detector.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/git_deps/detector.py b/git_deps/detector.py index 284a1bb..8f50d2c 100644 --- a/git_deps/detector.py +++ b/git_deps/detector.py @@ -1,11 +1,9 @@ -import logging import re import subprocess -import sys import pygit2 -from git_deps.utils import abort +from git_deps.utils import abort, debug_logger from git_deps.listener.base import DependencyListener from git_deps.errors import InvalidCommitish @@ -77,16 +75,7 @@ class DependencyDetector(object): if not self.options.debug: return logging.getLogger(self.__class__.__name__) - log_format = '%(asctime)-15s %(levelname)-6s %(message)s' - date_format = '%b %d %H:%M:%S' - formatter = logging.Formatter(fmt=log_format, datefmt=date_format) - handler = logging.StreamHandler(stream=sys.stdout) - handler.setFormatter(formatter) - # logger = logging.getLogger(__name__) - logger = logging.getLogger(self.__class__.__name__) - logger.setLevel(logging.DEBUG) - logger.addHandler(handler) - return logger + return debug_logger(self.__class__.__name__) def seen_commit(self, rev): return rev in self.commits |