[diffoscope] 01/01: Show the timestamp when logging so I know which steps take longer

Ximin Luo infinity0 at debian.org
Wed Aug 24 16:35:42 CEST 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository diffoscope.

commit d396eb39e1ef93dfa1327dd3306133a11eedc2d6
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed Aug 24 16:35:29 2016 +0200

    Show the timestamp when logging so I know which steps take longer
---
 diffoscope/__init__.py             | 2 +-
 diffoscope/comparators/__init__.py | 2 ++
 diffoscope/main.py                 | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/diffoscope/__init__.py b/diffoscope/__init__.py
index c6ab2bc..fbfd86e 100644
--- a/diffoscope/__init__.py
+++ b/diffoscope/__init__.py
@@ -33,7 +33,7 @@ logger.setLevel(logging.WARNING)
 ch = logging.StreamHandler()
 ch.setLevel(logging.DEBUG)
 logger.addHandler(ch)
-formatter = logging.Formatter('%(levelname)8s %(message)s')
+formatter = logging.Formatter('%(created)f %(levelname)8s %(message)s')
 ch.setFormatter(formatter)
 
 OS_NAMES = {
diff --git a/diffoscope/comparators/__init__.py b/diffoscope/comparators/__init__.py
index f9bbf6c..ab247cb 100644
--- a/diffoscope/comparators/__init__.py
+++ b/diffoscope/comparators/__init__.py
@@ -153,6 +153,8 @@ def compare_commented_files(file1, file2, comment=None, source=None):
 
 def specialize(file):
     for cls in FILE_CLASSES:
+        # Uncomment the below to see which comparisons take ages to run "identify"
+        #logger.debug("testing for %s", cls)
         if isinstance(file, cls):
             logger.debug("%s is already specialized", file.name)
             return file
diff --git a/diffoscope/main.py b/diffoscope/main.py
index 7cd234a..b54c44c 100644
--- a/diffoscope/main.py
+++ b/diffoscope/main.py
@@ -173,6 +173,7 @@ def run_diffoscope(parsed_args):
     if parsed_args.debug:
         logger.setLevel(logging.DEBUG)
     set_locale()
+    logger.debug('Starting comparison')
     difference = diffoscope.comparators.compare_root_paths(
         parsed_args.path1, parsed_args.path2)
     if difference:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list