Skip to content

Commit

Permalink
fix: Silly me overriding the wrong method.
Browse files Browse the repository at this point in the history
This fixes a lint error that we got from trying to use a protected
method. Thanks @gbanasiak for the catch.
  • Loading branch information
favilo committed Dec 13, 2024
1 parent e6c000a commit 39a56a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions esrally/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@ def __init__(
super().__init__(*args, **kwargs)
self.mutators = mutators or []

def format(self, record: logging.LogRecord) -> str:
def format_to_ecs(self, record: logging.LogRecord) -> typing.Dict[str, typing.Any]:
log_dict = super().format_to_ecs(record)
self.apply_mutators(record, log_dict)
# ecs_logging._utils is a private module
# but we need to use it here to get the on spec JSON serialization
return ecs_logging._utils.json_dumps(log_dict) # pylint: disable=protected-access
return log_dict

def apply_mutators(self, record: logging.LogRecord, log_dict: typing.Dict[str, typing.Any]) -> None:
for mutator in self.mutators:
Expand Down

0 comments on commit 39a56a9

Please sign in to comment.