@@ -48,19 +48,22 @@ def scan():
4848
4949def do_scan ():
5050 app_logging .setup ()
51-
51+ app_logging . get_logger (). info ( "Starting Pysonar, the Sonar scanner CLI for Python" )
5252 config = ConfigurationLoader .load ()
5353 set_logging_options (config )
54+ app_logging .get_logger ().debug (f"Loaded configuration: { config } " )
5455
5556 ConfigurationLoader .check_configuration (config )
5657
5758 api = build_api (config )
5859 check_version (api )
5960 update_config_with_api_urls (config , api .base_urls )
61+ app_logging .get_logger ().debug (f"Configuration after update from API URL: { config } " )
6062
6163 cache_manager = cache .get_cache (config )
6264 scanner = create_scanner_engine (api , cache_manager , config )
6365
66+ app_logging .get_logger ().info ("Starting the analysis..." )
6467 return scanner .run (config )
6568
6669
@@ -75,9 +78,12 @@ def build_api(config: dict[str, any]) -> SonarQubeApi:
7578
7679
7780def check_version (api : SonarQubeApi ):
81+ app_logging .get_logger ().info ("Checking SonarQube version..." )
7882 if api .is_sonar_qube_cloud ():
83+ app_logging .get_logger ().info ("Analysis will be run on SonarQube Cloud" )
7984 return
8085 version = api .get_analysis_version ()
86+ app_logging .get_logger ().info ("Analysis will be run on SonarQube version %s" , version )
8187 if not version .does_support_bootstrapping ():
8288 raise SQTooOldException (
8389 f"This scanner only supports SonarQube versions >= { MIN_SUPPORTED_SQ_VERSION } . \n "
@@ -95,8 +101,10 @@ def update_config_with_api_urls(config, base_urls: BaseUrls):
95101
96102
97103def create_scanner_engine (api , cache_manager , config ):
104+ app_logging .get_logger ().info ("Creating the scanner engine..." )
98105 jre_path = create_jre (api , cache_manager , config )
99106 config [SONAR_SCANNER_JAVA_EXE_PATH ] = str (jre_path .path )
107+ app_logging .get_logger ().debug (f"JRE path: { jre_path .path } " )
100108 scanner_engine_path = ScannerEngineProvisioner (api , cache_manager ).provision ()
101109 scanner = ScannerEngine (jre_path , scanner_engine_path )
102110 return scanner
0 commit comments