Skip to content

Commit caf3261

Browse files
authored
[Core AMQP] - Fix debug log output for Retries (Azure#12666)
## What - Add the operationType format specifier for debug logs ## Why The mismatch between the number of format specifiers and the variables passed in causes `NaN` to show up in the debug output. Before: ``` azure:core-amqp:verbose [connection-1] Attempt number: NaN 1 ... azure:core-amqp:verbose [connection-1] Success for 'sendMessage', after attempt number: 1. ``` After: ``` azure:core-amqp:verbose [connection-1] Attempt number for 'sendMessage': 1. ... azure:core-amqp:verbose [connection-1] Success for 'sendMessage', after attempt number: 1. ``` Fixes Azure#11798
1 parent e1a368a commit caf3261

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sdk/core/core-amqp/src/retry.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ export async function retry<T>(config: RetryConfig<T>): Promise<T> {
175175
let success = false;
176176
const totalNumberOfAttempts = config.retryOptions.maxRetries + 1;
177177
for (let i = 1; i <= totalNumberOfAttempts; i++) {
178-
logger.verbose("[%s] Attempt number: %d", config.connectionId, config.operationType, i);
178+
logger.verbose(
179+
"[%s] Attempt number for '%s': %d.",
180+
config.connectionId,
181+
config.operationType,
182+
i
183+
);
179184
try {
180185
result = await config.operation();
181186
success = true;

0 commit comments

Comments
 (0)