diff --git a/src/licensedcode/index.py b/src/licensedcode/index.py index 1a3f19d1fcd..0d270ff9306 100644 --- a/src/licensedcode/index.py +++ b/src/licensedcode/index.py @@ -36,6 +36,7 @@ import pickle as cPickle from functools import partial from operator import itemgetter +import os import pickle import sys from time import time @@ -74,7 +75,7 @@ """ # Tracing flags -TRACE = False +TRACE = False or os.environ.get('SCANCODE_DEBUG_LICENSE', False) TRACE_NEGATIVE = False TRACE_APPROX = False TRACE_APPROX_CANDIDATES = False @@ -794,7 +795,8 @@ def match(self, location=None, query_string=None, min_score=0, qry = query.build_query(location, query_string, idx=self, text_line_threshold=15, bin_line_threshold=50) - + if TRACE: + logger_debug('match: for:', location, 'query:', qry) if not qry: return []