Skip to content

Commit 256e94f

Browse files
committed
fix: consistent appending to args
Signed-off-by: Danju Visvanathan <danju.visvanathan@gmail.com>
1 parent 2b7f68c commit 256e94f

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

openfeature/hook/logging_hook.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,17 @@ def after(
5252
hints: HookHints,
5353
) -> None:
5454
args = self._build_args(hook_context)
55-
extra_args = {
56-
"stage": "after",
57-
"reason": details.reason,
58-
"variant": details.variant,
59-
"value": details.value,
60-
}
61-
self.logger.debug("After stage %s", {**args, **extra_args})
55+
args["stage"] = "after"
56+
args["reason"] = details.reason
57+
args["variant"] = details.variant
58+
args["value"] = details.value
59+
self.logger.debug("After stage %s", args)
6260

6361
def error(
6462
self, hook_context: HookContext, exception: Exception, hints: HookHints
6563
) -> None:
6664
args = self._build_args(hook_context)
67-
extra_args = {
68-
"stage": "error",
69-
"error_code": exception.error_code
70-
if isinstance(exception, OpenFeatureError)
71-
else ErrorCode.GENERAL,
72-
"error_message": str(exception),
73-
}
74-
self.logger.error("Error stage %s", {**args, **extra_args})
65+
args["stage"] = "error"
66+
args["error_code"] = exception.error_code if isinstance(exception, OpenFeatureError) else ErrorCode.GENERAL
67+
args["error_message"] = str(exception)
68+
self.logger.error("Error stage %s", args)

0 commit comments

Comments
 (0)