Skip to content

Commit

Permalink
chore: Overhaul log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanmigimeno committed Jul 1, 2024
1 parent deabcf4 commit a54dbda
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions src/expirer/expirer.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class ExpirerWorker {
txHash: confirmedOrder.txReceipt.hash,
};

this.logger.debug(
this.logger.info(
orderDescription,
`Successful expire processing: expire submitted.`,
);
Expand All @@ -233,7 +233,7 @@ class ExpirerWorker {
underwriteId: rejectedOrder.underwriteId,
};

this.logger.debug(
this.logger.info(
orderDescription,
`Unsuccessful expire processing: expire rejected.`,
);
Expand Down Expand Up @@ -347,7 +347,7 @@ class ExpirerWorker {
underwriteId: string,
expiry: number,
) {
this.logger.debug(
this.logger.info(
{ toInterface, underwriteId },
`Expire underwrite order received.`
);
Expand Down Expand Up @@ -379,7 +379,7 @@ class ExpirerWorker {
toInterface: string,
underwriteId: string,
) {
this.logger.debug(
this.logger.info(
{ toInterface, underwriteId },
`Expire underwrite order removal received.`
);
Expand Down
2 changes: 1 addition & 1 deletion src/expirer/queues/eval-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class EvalQueue extends ProcessingQueue<ExpireEvalOrder, ExpireOrder> {
};

if (success) {
this.logger.debug(
this.logger.info(
orderDescription,
`Successful expire evaluation.`,
);
Expand Down
4 changes: 2 additions & 2 deletions src/expirer/queues/expire-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ export class ExpireQueue extends ProcessingQueue<ExpireOrder, ExpireOrderResult>

if (success) {
if (result != null) {
this.logger.debug(
this.logger.info(
orderDescription,
`Successful expire processing: expire submitted.`,
);
} else {
this.logger.debug(
this.logger.info(
orderDescription,
`Successful expire processing: expire not submitted.`,
);
Expand Down
6 changes: 3 additions & 3 deletions src/monitor/monitor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class MonitorService implements OnModuleInit {
if (parsedMessage.event == "monitor") {
const monitorEvent = parsedMessage.data;
if (monitorEvent == undefined) {
this.logger.debug(
this.logger.warn(
{ parsedMessage },
"No data present on 'monitor' event."
);
Expand All @@ -200,7 +200,7 @@ export class MonitorService implements OnModuleInit {

const isEventValid = this.monitorEventValidator(monitorEvent);
if (!isEventValid) {
this.logger.debug(
this.logger.warn(
{ monitorEvent },
"Skipping monitor event: object schema invalid."
);
Expand All @@ -224,7 +224,7 @@ export class MonitorService implements OnModuleInit {

const chainConfig = this.chainConfig.get(eventChainId);
if (chainConfig == undefined) {
this.logger.debug(
this.logger.warn(
{ chainId: eventChainId },
`Skipping monitor event: chain not supported.`
);
Expand Down
4 changes: 2 additions & 2 deletions src/underwriter/queues/discover-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ export class DiscoverQueue extends ProcessingQueue<DiscoverOrder, EvalOrder> {

if (success) {
if (result != null) {
this.logger.debug(
this.logger.info(
orderDescription,
`Successful underwrite discovery: destination vault valid.`,
);

void this.registerSwapDataForTheExpirer(result);
} else {
this.logger.debug(
this.logger.info(
orderDescription,
`Successful underwrite discovery: destination vault invalid.`,
);
Expand Down
6 changes: 3 additions & 3 deletions src/underwriter/queues/eval-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export class EvalQueue extends ProcessingQueue<EvalOrder, UnderwriteOrder> {
};

if (success) {
this.logger.debug(
this.logger.info(
orderDescription,
`Successful underwrite evaluation.`,
);
Expand Down Expand Up @@ -324,11 +324,11 @@ export class EvalQueue extends ProcessingQueue<EvalOrder, UnderwriteOrder> {
// ********************************************************************************************
enableUnderwrites(): void {
this.enabled = true;
this.logger.debug('Underwriting enabled.');
this.logger.info('Underwriting enabled.');
}

disableUnderwrite(): void {
this.enabled = false;
this.logger.debug('Underwriting disabled.');
this.logger.info('Underwriting disabled.');
}
}
8 changes: 4 additions & 4 deletions src/underwriter/queues/underwrite-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ export class UnderwriteQueue extends ProcessingQueue<UnderwriteOrder, Underwrite

if (success) {
if (result != null) {
this.logger.debug(
this.logger.info(
orderDescription,
`Successful underwrite processing: underwrite submitted.`,
);
await this.requestRelayPrioritisation(order);
} else {
this.logger.debug(
this.logger.info(
orderDescription,
`Successful underwrite processing: underwrite not submitted.`,
);
Expand All @@ -189,7 +189,7 @@ export class UnderwriteQueue extends ProcessingQueue<UnderwriteOrder, Underwrite
}

if (!ambConfig.relayPrioritisation) {
this.logger.debug(
this.logger.info(
{ amb: order.amb, swapTxHash: order.swapTxHash, swapIdentifier: order.swapIdentifier },
'Skipping packet relay prioritisation: prioritisation disabled.'
);
Expand All @@ -205,7 +205,7 @@ export class UnderwriteQueue extends ProcessingQueue<UnderwriteOrder, Underwrite
destinationChainId: this.chainId,
};
try {
this.logger.debug(
this.logger.info(
{ ambMessageData, swapTxHash: order.swapTxHash, swapIdentifier: order.swapIdentifier },
'Requesting AMB message relay prioritisation.'
);
Expand Down
4 changes: 2 additions & 2 deletions src/underwriter/token-handler/approval-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class ApprovalHandler {
}

if (newSetAllowance != undefined) {
this.logger.debug(
this.logger.info(
{
interfaceAddress: this.interfaceAddress,
assetAddress,
Expand Down Expand Up @@ -201,7 +201,7 @@ export class ApprovalHandler {
newSetAllowance - oldSetAllowance // If old > new it effectively means 'increasing' the 'setAllowance'.
);
} else {
this.logger.debug(logDescription, 'Approval transaction success');
this.logger.info(logDescription, 'Approval transaction success');
}

}
Expand Down
4 changes: 2 additions & 2 deletions src/underwriter/underwriter.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class UnderwriterWorker {
txHash: confirmedOrder.txReceipt.hash,
};

this.logger.debug(
this.logger.info(
orderDescription,
`Successful underwrite processing: underwrite submitted.`,
);
Expand Down Expand Up @@ -412,7 +412,7 @@ class UnderwriterWorker {
deadline: bigint,
maxGasDelivery: bigint,
) {
this.logger.debug(
this.logger.info(
{ fromVault, fromChainId, swapTxHash, swapId: swapIdentifier },
`Underwrite order received.`
);
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/queues/confirm-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class ConfirmQueue extends ProcessingQueue<PendingTransaction, ConfirmedT
};

if (success) {
this.logger.debug(orderDescription, `Transaction confirmed.`);
this.logger.info(orderDescription, `Transaction confirmed.`);
} else {
this.logger.error(orderDescription, `Transaction not confirmed.`);
}
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/queues/submit-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ export class SubmitQueue extends ProcessingQueue<WalletTransactionRequest, Pendi

if (success) {
if (result != null) {
this.logger.debug(
this.logger.info(
orderDescription,
`Successful transaction processing: transaction submitted.`,
);
} else {
this.logger.debug(
this.logger.info(
orderDescription,
`Successful transaction processing: transaction not submitted.`,
);
Expand Down
8 changes: 4 additions & 4 deletions src/wallet/wallet.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class WalletWorker {
submissionError: tryErrorToString(transaction.submissionError)
};

this.logger.debug(
this.logger.info(
logDescription,
`Unsuccessful transaction processing: transaction failed.`,
);
Expand All @@ -348,7 +348,7 @@ class WalletWorker {
blockNumber: transaction.txReceipt.blockNumber
};

this.logger.debug(
this.logger.info(
logDescription,
`Successful transaction processing: transaction confirmed.`,
);
Expand Down Expand Up @@ -397,7 +397,7 @@ class WalletWorker {

await this.submitQueue.addOrders(requeueRequest);
} else {
this.logger.debug(
this.logger.info(
logDescription,
`Unsuccessful transaction processing: transaction rejected.`,
);
Expand Down Expand Up @@ -433,7 +433,7 @@ class WalletWorker {
return null;
}

this.logger.debug(
this.logger.info(
{ cancelTxNonce },
'Submitting transaction cancellation'
);
Expand Down

0 comments on commit a54dbda

Please sign in to comment.