Skip to content

Commit

Permalink
Enable license detection bug with env var #2058
Browse files Browse the repository at this point in the history
Setting SCANCODE_DEBUG_LICENSE enables tracing

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne committed Aug 3, 2020
1 parent a5ecfab commit 1465c64
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/licensedcode/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 []

Expand Down

0 comments on commit 1465c64

Please sign in to comment.