@@ -225,7 +225,7 @@ export class MirrorNodeClient {
225225 retryDelay : ( retryCount , error ) => {
226226 const delay = mirrorNodeRetryDelay * retryCount ;
227227 if ( this . logger . isLevelEnabled ( 'trace' ) ) {
228- this . logger . trace ( `Retry delay ${ delay } ms on '${ error ?. request ?. path } '` ) ;
228+ this . logger . trace ( `Retry delay %s ms on '%s'` , delay , error ?. request ?. path ) ;
229229 }
230230 return delay ;
231231 } ,
@@ -290,7 +290,9 @@ export class MirrorNodeClient {
290290 } ) ;
291291
292292 this . logger . info (
293- `Mirror Node client successfully configured to REST url: ${ this . restUrl } and Web3 url: ${ this . web3Url } ` ,
293+ `Mirror Node client successfully configured to REST url: %s and Web3 url: %s ` ,
294+ this . restUrl ,
295+ this . web3Url ,
294296 ) ;
295297 this . cacheService = cacheService ;
296298
@@ -377,7 +379,7 @@ export class MirrorNodeClient {
377379 try {
378380 return JSONBigInt . parse ( data ) ;
379381 } catch ( error ) {
380- this . logger . warn ( `Failed to parse response data from Mirror Node: ${ error } ` ) ;
382+ this . logger . warn ( `Failed to parse response data from Mirror Node: %s` , error ) ;
381383 }
382384 }
383385
@@ -394,9 +396,12 @@ export class MirrorNodeClient {
394396 const ms = Date . now ( ) - start ;
395397 if ( this . logger . isLevelEnabled ( 'debug' ) ) {
396398 this . logger . debug (
397- `Successfully received response from mirror node server: method=${ method } , path=${ path } , status=${
398- response . status
399- } , duration:${ ms } ms, data:${ JSON . stringify ( response . data ) } `,
399+ `Successfully received response from mirror node server: method=%s, path=%s, status=%s, duration:%sms, data:%s` ,
400+ method ,
401+ path ,
402+ response . status ,
403+ ms ,
404+ JSON . stringify ( response . data ) ,
400405 ) ;
401406 }
402407 this . mirrorResponseHistogram . labels ( pathLabel , response . status ?. toString ( ) ) . observe ( ms ) ;
@@ -451,27 +456,35 @@ export class MirrorNodeClient {
451456 const acceptedErrorResponses = MirrorNodeClient . acceptedErrorStatusesResponsePerRequestPathMap . get ( pathLabel ) ;
452457
453458 if ( error . response && acceptedErrorResponses ?. includes ( effectiveStatusCode ) ) {
454- if ( this . logger . isLevelEnabled ( 'debug' ) ) {
455- this . logger . debug (
456- `An accepted error occurred while communicating with the mirror node server: method=${ method } , path=${ path } , status=${ effectiveStatusCode } ` ,
457- ) ;
458- }
459+ this . logger . debug (
460+ `An accepted error occurred while communicating with the mirror node server: method=%s, path=%s, status=%s}` ,
461+ method ,
462+ path ,
463+ effectiveStatusCode ,
464+ ) ;
459465 return null ;
460466 }
461467
462468 // Contract Call returns 400 for a CONTRACT_REVERT but is a valid response, expected and should not be logged as error:
463469 if ( pathLabel === MirrorNodeClient . CONTRACT_CALL_ENDPOINT && effectiveStatusCode === 400 ) {
464470 if ( this . logger . isLevelEnabled ( 'debug' ) ) {
465471 this . logger . debug (
466- `[${ method } ] ${ path } Contract Revert: ( StatusCode: '${ effectiveStatusCode } ', StatusText: '${
467- error . response . statusText
468- } ', Detail: '${ JSON . stringify ( error . response . detail ) } ',Data: '${ JSON . stringify ( error . response . data ) } ')`,
472+ `[%s] %s Contract Revert: ( StatusCode: '%s', StatusText: '%s', Detail: '%s',Data: '%s')` ,
473+ method ,
474+ path ,
475+ effectiveStatusCode ,
476+ error . response . statusText ,
477+ JSON . stringify ( error . response . detail ) ,
478+ JSON . stringify ( error . response . data ) ,
469479 ) ;
470480 }
471481 } else {
472482 this . logger . error (
473483 new Error ( error . message ) ,
474- `Error encountered while communicating with the mirror node server: method=${ method } , path=${ path } , status=${ effectiveStatusCode } ` ,
484+ `Error encountered while communicating with the mirror node server: method=%s, path=%s, status=%s` ,
485+ method ,
486+ path ,
487+ effectiveStatusCode ,
475488 ) ;
476489 }
477490
@@ -497,7 +510,7 @@ export class MirrorNodeClient {
497510 if ( page === pageMax ) {
498511 // max page reached
499512 if ( this . logger . isLevelEnabled ( 'trace' ) ) {
500- this . logger . trace ( `Max page reached ${ pageMax } with ${ results . length } results` ) ;
513+ this . logger . trace ( `Max page reached %s with %s results` , pageMax , results . length ) ;
501514 }
502515 throw predefined . PAGINATION_MAX ( pageMax ) ;
503516 }
@@ -575,15 +588,15 @@ export class MirrorNodeClient {
575588 const match = url . match ( regex ) ;
576589 const accountId = match ? match [ 1 ] : null ;
577590 if ( ! accountId ) {
578- this . logger . error ( `Unable to extract evm address from url ${ url } ` ) ;
591+ this . logger . error ( `Unable to extract evm address from url %s` , url ) ;
579592 }
580593 return String ( accountId ) ;
581594 } else {
582595 // account id
583596 const match = url . match ( MirrorNodeClient . EVM_ADDRESS_REGEX ) ;
584597 const accountId = match ? match [ 1 ] : null ;
585598 if ( ! accountId ) {
586- this . logger . error ( `Unable to extract account ID from url ${ url } ` ) ;
599+ this . logger . error ( `Unable to extract account ID from url %s` , url ) ;
587600 }
588601 return String ( accountId ) ;
589602 }
@@ -802,9 +815,9 @@ export class MirrorNodeClient {
802815 // Found immature record, log the info, set flag and exit record traversal
803816 if ( this . logger . isLevelEnabled ( 'debug' ) ) {
804817 this . logger . debug (
805- `Contract result contains nullable transaction_index or block_number, or block_hash is an empty hex (0x): contract_result=${ JSON . stringify (
806- contractObject ,
807- ) } . ${ ! isLastAttempt ? `Retrying after a delay of ${ mirrorNodeRetryDelay } ms.` : `` } `,
818+ `Contract result contains nullable transaction_index or block_number, or block_hash is an empty hex (0x): contract_result=%s. %s}` ,
819+ JSON . stringify ( contractObject ) ,
820+ ! isLastAttempt ? `Retrying after a delay of ${ mirrorNodeRetryDelay } ms.` : `` ,
808821 ) ;
809822 }
810823
@@ -991,9 +1004,9 @@ export class MirrorNodeClient {
9911004 // Found immature record, log the info, set flag and exit record traversal
9921005 if ( this . logger . isLevelEnabled ( 'debug' ) ) {
9931006 this . logger . debug (
994- `Contract result log contains nullable transaction_index, block_number, index, or block_hash is an empty hex (0x): log=${ JSON . stringify (
995- log ,
996- ) } . ${ ! isLastAttempt ? `Retrying after a delay of ${ mirrorNodeRetryDelay } ms.` : `` } `,
1007+ `Contract result log contains nullable transaction_index, block_number, index, or block_hash is an empty hex (0x): log=%s. %s` ,
1008+ JSON . stringify ( log ) ,
1009+ ! isLastAttempt ? `Retrying after a delay of ${ mirrorNodeRetryDelay } ms.` : `` ,
9971010 ) ;
9981011 }
9991012
@@ -1484,7 +1497,9 @@ export class MirrorNodeClient {
14841497 } else {
14851498 this . logger . warn (
14861499 e ,
1487- `Error raised during polling mirror node for updated records: method=${ methodName } , args=${ args } ` ,
1500+ `Error raised during polling mirror node for updated records: method=%s, args=%s` ,
1501+ methodName ,
1502+ args ,
14881503 ) ;
14891504 }
14901505 }
@@ -1495,9 +1510,12 @@ export class MirrorNodeClient {
14951510
14961511 if ( this . logger . isLevelEnabled ( 'debug' ) ) {
14971512 this . logger . debug (
1498- `Repeating request ${ methodName } with args ${ JSON . stringify (
1499- args ,
1500- ) } retry count ${ i } of ${ repeatCount } . Waiting ${ this . MIRROR_NODE_RETRY_DELAY } ms before repeating request`,
1513+ `Repeating request %s with args %s retry count %s of %s. Waiting %s ms before repeating request` ,
1514+ methodName ,
1515+ JSON . stringify ( args ) ,
1516+ i ,
1517+ repeatCount ,
1518+ this . MIRROR_NODE_RETRY_DELAY ,
15011519 ) ;
15021520 }
15031521
@@ -1523,12 +1541,11 @@ export class MirrorNodeClient {
15231541 operatorAccountId : string ,
15241542 requestDetails : RequestDetails ,
15251543 ) : Promise < ITransactionRecordMetric > {
1526- if ( this . logger . isLevelEnabled ( 'debug' ) ) {
1527- this . logger . debug (
1528- `Get transaction record via mirror node: transactionId=${ transactionId } , txConstructorName=${ txConstructorName } ` ,
1529- ) ;
1530- }
1531-
1544+ this . logger . debug (
1545+ `Get transaction record via mirror node: transactionId=%s, txConstructorName=%s` ,
1546+ transactionId ,
1547+ txConstructorName ,
1548+ ) ;
15321549 // Create a modified copy of requestDetails
15331550 const modifiedRequestDetails = new RequestDetails ( {
15341551 requestId : requestDetails . requestId ,
0 commit comments