Skip to content

Commit 346bfdb

Browse files
committed
Fix debug level
1 parent c295441 commit 346bfdb

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

cli/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def parse_and_check(parser: ArgumentParser, logger_name: str = None, verify_toke
193193
log.info("sonar-tools version %s", version.PACKAGE_VERSION)
194194
if os.getenv("IN_DOCKER", "No") == "Yes":
195195
kwargs[URL] = kwargs[URL].replace("http://localhost", "http://host.docker.internal")
196-
if log.get_level() >= log.DEBUG:
196+
if log.get_level() <= log.DEBUG:
197197
sanitized_args = kwargs.copy()
198198
sanitized_args[TOKEN] = utilities.redacted_token(sanitized_args[TOKEN])
199199
if "tokenTarget" in sanitized_args:

sonar/platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def __run_request(
225225
if kwargs.get("with_organization", True):
226226
params["organization"] = self.organization
227227
req_type, url = "", ""
228-
if log.get_level() >= log.DEBUG:
228+
if log.get_level() <= log.DEBUG:
229229
req_type = getattr(request, "__name__", repr(request)).upper()
230230
url = self.__urlstring(api, params)
231231
log.debug("%s: %s", req_type, url)

sonar/projects.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,9 +1486,8 @@ def __export_thread(queue: Queue[Project], results: dict[str, str], export_setti
14861486
with _CLASS_LOCK:
14871487
export_settings["EXPORTED"] += 1
14881488
nb, tot = export_settings["EXPORTED"], export_settings["NBR_PROJECTS"]
1489-
if log.get_level() >= log.DEBUG:
1490-
log.debug("%d/%d projects exported (%d%%)", nb, tot, (nb * 100) // tot)
1491-
elif nb % 10 == 0 or tot - nb < 10:
1489+
log.debug("%d/%d projects exported (%d%%)", nb, tot, (nb * 100) // tot)
1490+
if nb % 10 == 0 or tot - nb < 10:
14921491
log.info("%d/%d projects exported (%d%%)", nb, tot, (nb * 100) // tot)
14931492
queue.task_done()
14941493

0 commit comments

Comments
 (0)