From e6c000acf34964a2f72b697eefcd64fd3c8387d8 Mon Sep 17 00:00:00 2001 From: favilo Date: Tue, 10 Dec 2024 13:11:18 -0800 Subject: [PATCH] ci: Lint fixes Removed old stuff, and pulled out MutatorType to make the RallyEcsFormatter definition shorter --- esrally/log.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/esrally/log.py b/esrally/log.py index 2b047923d..f58a2af0a 100644 --- a/esrally/log.py +++ b/esrally/log.py @@ -43,11 +43,14 @@ def configure_utc_formatter(*args: typing.Any, **kwargs: typing.Any) -> logging. return formatter +MutatorType = typing.Callable[[logging.LogRecord, typing.Dict[str, typing.Any]], None] + + class RallyEcsFormatter(ecs_logging.StdlibFormatter): def __init__( self, - mutators: typing.Optional[typing.List[typing.Callable[[typing.Dict[str, typing.Any]], None]]] = None, *args: typing.Any, + mutators: typing.Optional[typing.List[MutatorType]] = None, **kwargs: typing.Any, ): super().__init__(*args, **kwargs) @@ -95,15 +98,6 @@ def configure_ecs_formatter(*args: typing.Any, **kwargs: typing.Any) -> ecs_logg return formatter -def configure_json_formatter(*args: typing.Any, **kwargs: typing.Any) -> RallyJsonFormatter: - """ - JSON Logging formatter - """ - formatter = jsonlogger.JsonFormatter(*args, **kwargs) - - return formatter - - def log_config_path(): """ :return: The absolute path to Rally's log configuration file.