Skip to content

Commit 65868af

Browse files
authored
Merge pull request #86 from fosslight/develop
Print tool information to log
2 parents 53b9771 + a41ff55 commit 65868af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/fosslight_source/cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from .run_scancode import run_scan
2020
from .run_scanoss import run_scanoss_py
2121
from .run_scanoss import get_scanoss_extra_info
22+
import yaml
2223

2324
SCANOSS_SHEET_NAME = 'SRC_FL_Source'
2425
SCANOSS_HEADER = {SCANOSS_SHEET_NAME: ['ID', 'Source Name or Path', 'OSS Name',
@@ -91,7 +92,6 @@ def main():
9192
True, logging.INFO, logging.DEBUG, _PKG_NAME, path_to_scan)
9293

9394
if os.path.isdir(path_to_scan):
94-
9595
if selected_scanner == 'scancode':
9696
success, _result_log["Scan Result"], scanned_result, license_list = run_scan(path_to_scan, output_file_name,
9797
write_json_file, -1, True,
@@ -109,6 +109,10 @@ def main():
109109
sys.exit(1)
110110
create_report_file(start_time, scanned_result, license_list, selected_scanner, print_matched_text,
111111
output_path, output_file, output_extension)
112+
try:
113+
logger.info(yaml.safe_dump(_result_log, allow_unicode=True, sort_keys=True))
114+
except Exception as ex:
115+
logger.debug(f"Failed to print log.: {ex}")
112116
else:
113117
logger.error(f"Check the path to scan. : {path_to_scan}")
114118
sys.exit(1)

0 commit comments

Comments
 (0)