@@ -224,9 +224,7 @@ export class MirrorNodeClient {
224224 retries : mirrorNodeRetries ,
225225 retryDelay : ( retryCount , error ) => {
226226 const delay = mirrorNodeRetryDelay * retryCount ;
227- if ( this . logger . isLevelEnabled ( 'trace' ) ) {
228- this . logger . trace ( `Retry delay ${ delay } ms on '${ error ?. request ?. path } '` ) ;
229- }
227+ this . logger . trace ( `Retry delay %s ms on '%s'` , delay , error ?. request ?. path ) ;
230228 return delay ;
231229 } ,
232230 retryCondition : ( error ) => {
@@ -290,7 +288,9 @@ export class MirrorNodeClient {
290288 } ) ;
291289
292290 this . logger . info (
293- `Mirror Node client successfully configured to REST url: ${ this . restUrl } and Web3 url: ${ this . web3Url } ` ,
291+ `Mirror Node client successfully configured to REST url: %s and Web3 url: %s ` ,
292+ this . restUrl ,
293+ this . web3Url ,
294294 ) ;
295295 this . cacheService = cacheService ;
296296
@@ -377,7 +377,7 @@ export class MirrorNodeClient {
377377 try {
378378 return JSONBigInt . parse ( data ) ;
379379 } catch ( error ) {
380- this . logger . warn ( `Failed to parse response data from Mirror Node: ${ error } ` ) ;
380+ this . logger . warn ( `Failed to parse response data from Mirror Node: %s` , error ) ;
381381 }
382382 }
383383
@@ -394,9 +394,12 @@ export class MirrorNodeClient {
394394 const ms = Date . now ( ) - start ;
395395 if ( this . logger . isLevelEnabled ( 'debug' ) ) {
396396 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 ) } `,
397+ `Successfully received response from mirror node server: method=%s, path=%s, status=%s, duration:%sms, data:%s` ,
398+ method ,
399+ path ,
400+ response . status ,
401+ ms ,
402+ JSON . stringify ( response . data ) ,
400403 ) ;
401404 }
402405 this . mirrorResponseHistogram . labels ( pathLabel , response . status ?. toString ( ) ) . observe ( ms ) ;
@@ -451,27 +454,35 @@ export class MirrorNodeClient {
451454 const acceptedErrorResponses = MirrorNodeClient . acceptedErrorStatusesResponsePerRequestPathMap . get ( pathLabel ) ;
452455
453456 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- }
457+ this . logger . debug (
458+ `An accepted error occurred while communicating with the mirror node server: method=%s, path=%s, status=%s}` ,
459+ method ,
460+ path ,
461+ effectiveStatusCode ,
462+ ) ;
459463 return null ;
460464 }
461465
462466 // Contract Call returns 400 for a CONTRACT_REVERT but is a valid response, expected and should not be logged as error:
463467 if ( pathLabel === MirrorNodeClient . CONTRACT_CALL_ENDPOINT && effectiveStatusCode === 400 ) {
464468 if ( this . logger . isLevelEnabled ( 'debug' ) ) {
465469 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 ) } ')`,
470+ `[%s] %s Contract Revert: ( StatusCode: '%s', StatusText: '%s', Detail: '%s',Data: '%s')` ,
471+ method ,
472+ path ,
473+ effectiveStatusCode ,
474+ error . response . statusText ,
475+ JSON . stringify ( error . response . detail ) ,
476+ JSON . stringify ( error . response . data ) ,
469477 ) ;
470478 }
471479 } else {
472480 this . logger . error (
473481 new Error ( error . message ) ,
474- `Error encountered while communicating with the mirror node server: method=${ method } , path=${ path } , status=${ effectiveStatusCode } ` ,
482+ `Error encountered while communicating with the mirror node server: method=%s, path=%s, status=%s` ,
483+ method ,
484+ path ,
485+ effectiveStatusCode ,
475486 ) ;
476487 }
477488
@@ -496,9 +507,7 @@ export class MirrorNodeClient {
496507
497508 if ( page === pageMax ) {
498509 // max page reached
499- if ( this . logger . isLevelEnabled ( 'trace' ) ) {
500- this . logger . trace ( `Max page reached ${ pageMax } with ${ results . length } results` ) ;
501- }
510+ this . logger . trace ( `Max page reached %s with %s results` , pageMax , results . length ) ;
502511 throw predefined . PAGINATION_MAX ( pageMax ) ;
503512 }
504513
@@ -575,15 +584,15 @@ export class MirrorNodeClient {
575584 const match = url . match ( regex ) ;
576585 const accountId = match ? match [ 1 ] : null ;
577586 if ( ! accountId ) {
578- this . logger . error ( `Unable to extract evm address from url ${ url } ` ) ;
587+ this . logger . error ( `Unable to extract evm address from url %s` , url ) ;
579588 }
580589 return String ( accountId ) ;
581590 } else {
582591 // account id
583592 const match = url . match ( MirrorNodeClient . EVM_ADDRESS_REGEX ) ;
584593 const accountId = match ? match [ 1 ] : null ;
585594 if ( ! accountId ) {
586- this . logger . error ( `Unable to extract account ID from url ${ url } ` ) ;
595+ this . logger . error ( `Unable to extract account ID from url %s` , url ) ;
587596 }
588597 return String ( accountId ) ;
589598 }
@@ -802,9 +811,9 @@ export class MirrorNodeClient {
802811 // Found immature record, log the info, set flag and exit record traversal
803812 if ( this . logger . isLevelEnabled ( 'debug' ) ) {
804813 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.` : `` } `,
814+ `Contract result contains nullable transaction_index or block_number, or block_hash is an empty hex (0x): contract_result=%s. %s}` ,
815+ JSON . stringify ( contractObject ) ,
816+ ! isLastAttempt ? `Retrying after a delay of ${ mirrorNodeRetryDelay } ms.` : `` ,
808817 ) ;
809818 }
810819
@@ -991,9 +1000,9 @@ export class MirrorNodeClient {
9911000 // Found immature record, log the info, set flag and exit record traversal
9921001 if ( this . logger . isLevelEnabled ( 'debug' ) ) {
9931002 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.` : `` } `,
1003+ `Contract result log contains nullable transaction_index, block_number, index, or block_hash is an empty hex (0x): log=%s. %s` ,
1004+ JSON . stringify ( log ) ,
1005+ ! isLastAttempt ? `Retrying after a delay of ${ mirrorNodeRetryDelay } ms.` : `` ,
9971006 ) ;
9981007 }
9991008
@@ -1484,7 +1493,9 @@ export class MirrorNodeClient {
14841493 } else {
14851494 this . logger . warn (
14861495 e ,
1487- `Error raised during polling mirror node for updated records: method=${ methodName } , args=${ args } ` ,
1496+ `Error raised during polling mirror node for updated records: method=%s, args=%s` ,
1497+ methodName ,
1498+ args ,
14881499 ) ;
14891500 }
14901501 }
@@ -1495,9 +1506,12 @@ export class MirrorNodeClient {
14951506
14961507 if ( this . logger . isLevelEnabled ( 'debug' ) ) {
14971508 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`,
1509+ `Repeating request %s with args %s retry count %s of %s. Waiting %s ms before repeating request` ,
1510+ methodName ,
1511+ JSON . stringify ( args ) ,
1512+ i ,
1513+ repeatCount ,
1514+ this . MIRROR_NODE_RETRY_DELAY ,
15011515 ) ;
15021516 }
15031517
@@ -1523,12 +1537,11 @@ export class MirrorNodeClient {
15231537 operatorAccountId : string ,
15241538 requestDetails : RequestDetails ,
15251539 ) : 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-
1540+ this . logger . debug (
1541+ `Get transaction record via mirror node: transactionId=%s, txConstructorName=%s` ,
1542+ transactionId ,
1543+ txConstructorName ,
1544+ ) ;
15321545 // Create a modified copy of requestDetails
15331546 const modifiedRequestDetails = new RequestDetails ( {
15341547 requestId : requestDetails . requestId ,
0 commit comments