diff --git a/dojo/jira_link/views.py b/dojo/jira_link/views.py index 0461f600dee..84d33e6ffdd 100644 --- a/dojo/jira_link/views.py +++ b/dojo/jira_link/views.py @@ -100,10 +100,10 @@ def webhook(request, secret=None): findings = None # Determine what type of object we will be working with if jissue.finding: - logging.debug(f"Received issue update for {jissue.jira_key} for finding {jissue.finding.id}") + logger.debug(f"Received issue update for {jissue.jira_key} for finding {jissue.finding.id}") findings = [jissue.finding] elif jissue.finding_group: - logging.debug(f"Received issue update for {jissue.jira_key} for finding group {jissue.finding_group}") + logger.debug(f"Received issue update for {jissue.jira_key} for finding group {jissue.finding_group}") findings = jissue.finding_group.findings.all() elif jissue.engagement: return webhook_responser_handler("debug", "Update for engagement ignored") @@ -228,7 +228,7 @@ def check_for_and_create_comment(parsed_json): jissue = JIRA_Issue.objects.get(jira_id=jid) except JIRA_Instance.DoesNotExist: return webhook_responser_handler("info", f"JIRA issue {jid} is not linked to a DefectDojo Finding") - logging.debug(f"Received issue comment for {jissue.jira_key}") + logger.debug(f"Received issue comment for {jissue.jira_key}") logger.debug("jissue: %s", vars(jissue)) jira_usernames = JIRA_Instance.objects.values_list("username", flat=True) diff --git a/dojo/management/commands/print_settings.py b/dojo/management/commands/print_settings.py index 6aea64876bf..ce6ab9feefe 100644 --- a/dojo/management/commands/print_settings.py +++ b/dojo/management/commands/print_settings.py @@ -21,4 +21,4 @@ def handle(self, *args, **options): value = getattr(settings, attr) a_dict[attr] = value - logging.info(pformat(a_dict)) + logger.info(pformat(a_dict)) diff --git a/dojo/models.py b/dojo/models.py index 037b22b919f..23ab5e31d36 100644 --- a/dojo/models.py +++ b/dojo/models.py @@ -1784,7 +1784,7 @@ def clean(self): action_string = "Postgres does not accept NULL character. Attempting to replace with %00..." for remove_str in null_char_list: self.path = self.path.replace(remove_str, "%00") - logging.error(f'Path "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}') + logger.error(f'Path "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}') if self.path == "": self.path = None @@ -1797,7 +1797,7 @@ def clean(self): action_string = "Postgres does not accept NULL character. Attempting to replace with %00..." for remove_str in null_char_list: self.query = self.query.replace(remove_str, "%00") - logging.error(f'Query "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}') + logger.error(f'Query "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}') if self.query == "": self.query = None @@ -1810,7 +1810,7 @@ def clean(self): action_string = "Postgres does not accept NULL character. Attempting to replace with %00..." for remove_str in null_char_list: self.fragment = self.fragment.replace(remove_str, "%00") - logging.error(f'Fragment "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}') + logger.error(f'Fragment "{old_value}" has invalid format - It contains the NULL character. The following action was taken: {action_string}') if self.fragment == "": self.fragment = None diff --git a/dojo/notes/helper.py b/dojo/notes/helper.py index 80f6f80a2a8..c0eb807e8be 100644 --- a/dojo/notes/helper.py +++ b/dojo/notes/helper.py @@ -7,5 +7,5 @@ def delete_related_notes(obj): if not hasattr(obj, "notes"): logger.warning(f"Attempted to delete notes from object type {type(obj)} without 'notes' attribute.") return - logging.debug(f"Deleting {obj.notes.count()} notes for {type(obj).__name__} {obj.id}") + logger.debug(f"Deleting {obj.notes.count()} notes for {type(obj).__name__} {obj.id}") obj.notes.all().delete() diff --git a/dojo/notes/signals.py b/dojo/notes/signals.py index 222efba832f..3865a1b81a5 100644 --- a/dojo/notes/signals.py +++ b/dojo/notes/signals.py @@ -9,7 +9,7 @@ def delete_note_history(note): - logging.debug(f"Deleting history for note {note.id}") + logger.debug(f"Deleting history for note {note.id}") note.history.all().delete() diff --git a/dojo/tools/api_sonarqube/importer.py b/dojo/tools/api_sonarqube/importer.py index 77801de0e24..d5f482491d8 100644 --- a/dojo/tools/api_sonarqube/importer.py +++ b/dojo/tools/api_sonarqube/importer.py @@ -128,7 +128,7 @@ def import_issues(self, test): organization=organization, branch=test.branch_tag, ) - logging.info( + logger.info( f'Found {len(issues)} issues for component {component["key"]}', ) @@ -247,7 +247,7 @@ def import_hotspots(self, test): organization=organization, branch=test.branch_tag, ) - logging.info( + logger.info( f'Found {len(hotspots)} hotspots for project {component["key"]}', ) sonarUrl = client.sonar_api_url[:-3] # [:-3] removes the /api part of the sonarqube/cloud URL