Skip to content

Commit a4b8fa7

Browse files
Improve the bugbot rule name reporting in the logs (#2755)
1 parent 4d9ff09 commit a4b8fa7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bugbot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def get_version():
5555
raise
5656

5757

58-
logger_extra = {"bugbot_rule": None}
58+
logger_extra: dict[str, str] = {}
5959

6060

6161
def create_logger(logger_extra):

bugbot/bzcleaner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def __init__(self):
6363
self.cache = Cache(self.name(), self.max_days_in_cache())
6464
self.test_mode = utils.get_config("common", "test", False)
6565
self.versions = None
66-
logger.info("Run rule {}".format(self.get_rule_path()))
6766

6867
def _set_rule_name(self):
6968
module = sys.modules[self.__class__.__module__]
@@ -843,6 +842,7 @@ def get_args_parser(self):
843842
def run(self):
844843
"""Run the rule"""
845844
logger_extra["bugbot_rule"] = self.name()
845+
logger.info("Run rule %s", self.get_rule_path())
846846

847847
args = self.get_args_parser().parse_args()
848848
self.parse_custom_arguments(args)

0 commit comments

Comments
 (0)