diff --git a/Makefile b/Makefile index 069d41a9..d019a429 100644 --- a/Makefile +++ b/Makefile @@ -62,8 +62,7 @@ html: content @echo making HTML content $(Q)./scripts/show-versions.py @echo zjy make html - $(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b html -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) - #@echo zjy filter doc in log + $(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b html -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) > $(BUILDDIR)/doc.log 2>&1 $(Q)./scripts/filter-doc-log.sh $(BUILDDIR)/doc.log @echo zjy done singlehtml: content diff --git a/scripts/filter-known-issues.py b/scripts/filter-known-issues.py index e72436e6..b8729bd4 100755 --- a/scripts/filter-known-issues.py +++ b/scripts/filter-known-issues.py @@ -139,26 +139,27 @@ def filter_log(args): continue # skip empty log files try: with open(filename, "r+b") as f: - # logging.info("%s: filtering", filename) + logging.info("%s: filtering", filename) # Yeah, this should be more protected in case of exception # and such, but this is a short running program... mm = mmap.mmap(f.fileno(), 0) + print("exclude_regexs", exclude_regexs) for ex, origin, flags in exclude_regexs: - # logging.info("%s: searching from %s: %s", - # filename, origin, ex.pattern) + logging.info("%s: searching from %s: %s", + filename, origin, ex.pattern) for m in re.finditer(ex.pattern, mm, re.MULTILINE): - # logging.info("%s: %s-%s: match from from %s %s", - # filename, m.start(), m.end(), origin, flags) + logging.info("%s: %s-%s: match from from %s %s", + filename, m.start(), m.end(), origin, flags) if 'warning' in flags: exclude_ranges.append((m.start(), m.end(), True)) else: exclude_ranges.append((m.start(), m.end(), False)) exclude_ranges = sorted(exclude_ranges, key=lambda r: r[0]) - # logging.warning( - # "%s: ranges excluded: %s", - # filename, - # exclude_ranges) + logging.warning( + "%s: ranges excluded: %s", + filename, + exclude_ranges) # Decide what to do with what has been filtered; warnings # go to stderr and warnings file, errors to stdout, what @@ -168,14 +169,14 @@ def filter_log(args): mm.seek(offset) if b > offset: # We have something not caught by a filter, an error - # logging.info("%s: error range (%d, %d), from %d %dB", - # filename, offset, b, offset, b - offset) + logging.info("%s: error range (%d, %d), from %d %dB", + filename, offset, b, offset, b - offset) print_error(fout, mm.read(b - offset)) mm.seek(b) if warning == True: # A warning, print it mm.seek(b) - # logging.info("%s: warning range (%d, %d), from %d %dB", - # filename, b, e, offset, e - b) + logging.info("%s: warning range (%d, %d), from %d %dB", + filename, b, e, offset, e - b) print_error(fout, mm.read(e - b)) else: # Exclude, ignore it d = b - offset @@ -184,8 +185,8 @@ def filter_log(args): offset = e mm.seek(offset) if len(mm) != offset: - # logging.info("%s: error final range from %d %dB", - # filename, offset, len(mm)) + logging.info("%s: error final range from %d %dB", + filename, offset, len(mm)) print_error(fout, mm.read(len(mm) - offset - 1)) del mm f.close()