Skip to content

Commit b1e3dba

Browse files
committed
Support .info("foo %s", "bar") formatting in logger
1 parent e5381ae commit b1e3dba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

aws_lambda_powertools/logging/formatter.py

+3
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ def _extract_log_message(self, log_record: logging.LogRecord) -> Union[Dict[str,
176176
if isinstance(message, dict):
177177
return message
178178

179+
if log_record.args: # logger.info("foo %s", "bar") requires formatting
180+
return log_record.getMessage()
181+
179182
if isinstance(message, str): # could be a JSON string
180183
try:
181184
message = self.json_deserializer(message)

0 commit comments

Comments
 (0)