You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log("Warning: could not decode '{}' with {} or fallback encodings ({}); ignoring errors".format(source, default_encoding, ",".join(fallback_encodings)))
237
+
logging.warning("Could not decode '{}' with {} or fallback encodings ({}); ignoring errors".format(source, default_encoding, ",".join(fallback_encodings)))
log("Spawned {} threads each scanning at most {} source files".format(len(threads), chunk_size))
292
+
logging.info("Spawned {} threads each scanning at most {} source files".format(len(threads), chunk_size))
276
293
fortinthreads:
277
294
t.join()
278
295
@@ -395,7 +412,7 @@ def addLists(list1, list2):
395
412
return [b1+b2forb1, b2inzip(list1, list2)]
396
413
else:
397
414
# One report had different number branch measurements than the other, print a warning
398
-
sys.stderr.write("Warning: possible loss of correctness. Different number of branches for same line when combining reports ({} vs {})\n".format(list1, list2))
415
+
logging.warning("Possible loss of correctness. Different number of branches for same line when combining reports ({} vs {})\n".format(list1, list2))
399
416
returnlist1iflen(list1) >len(list2) elselist2
400
417
401
418
defcombineReports(base, overlay):
@@ -496,25 +513,25 @@ def parseAndCombine(paths):
496
513
497
514
ifnotbase_report:
498
515
base_report=report
499
-
log("Setting {} as base report".format(path))
516
+
logging.info("Setting {} as base report".format(path))
500
517
else:
501
518
combineReports(base_report, report)
502
-
log("Adding {} to base report".format(path))
519
+
logging.info("Adding {} to base report".format(path))
503
520
504
521
returnbase_report
505
522
506
523
defcombineCoverageFiles(args):
507
-
log("Performing combine operation")
524
+
logging.info("Performing combine operation")
508
525
fastcov_json=parseAndCombine(args.combine)
509
526
dumpFile(fastcov_json, args)
510
527
511
528
defdumpFile(fastcov_json, args):
512
529
ifargs.lcov:
513
530
dumpToLcovInfo(fastcov_json, args.output)
514
-
log("Created lcov info file '{}'".format(args.output))
531
+
logging.info("Created lcov info file '{}'".format(args.output))
parser.add_argument('-t', '--test-name', dest='test_name', default="", help='Specify a test name for the coverage. Equivalent to lcov\'s `-t`.')
559
576
parser.add_argument('-C', '--add-tracefile', dest='combine', nargs="+", help='Combine multiple coverage files into one. If this flag is specified, fastcov will do a combine operation instead invoking gcov. Equivalent to lcov\'s `-a`.')
560
577
578
+
parser.add_argument('-V', '--verbose', dest="verbose", action="store_true", help="Print more detailed information about what fastcov is doing")
561
579
parser.add_argument('-v', '--version', action="version", version='%(prog)s {version}'.format(version=__version__), help="Show program's version number and exit")
562
580
563
581
args=parser.parse_args()
564
582
565
-
defarg_logger(line):
566
-
logger(line, quiet=args.quiet)
567
-
568
-
# Change global logger settings to reflect arguments
log("Aggregated raw gcov JSON into fastcov JSON report")
653
+
logging.info("Aggregated raw gcov JSON into fastcov JSON report")
654
+
logging.debug("Final report will contain coverage for the following %d source files:\n %s", len(fastcov_json["sources"]), "\n ".join(fastcov_json["sources"]))
0 commit comments