Skip to content

Commit

Permalink
chore: reduce unused logging (#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
arcoraven authored Oct 29, 2024
1 parent 0989e4f commit 844d297
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 35 deletions.
23 changes: 1 addition & 22 deletions src/server/routes/transaction/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ export async function checkTxStatus(fastify: FastifyInstance) {
},
wsHandler: async (connection: SocketStream, request) => {
const { queueId } = request.params;
// const timeout = await wsTimeout(connection, queueId, request);

logger({
service: "websocket",
level: "info",
message: `Websocket connection established for ${queueId}`,
});

findOrAddWSConnectionInSharedState(connection, queueId, request);

Expand All @@ -125,33 +118,19 @@ export async function checkTxStatus(fastify: FastifyInstance) {
logger({
service: "websocket",
level: "error",
message: `Websocket error`,
message: "Websocket error",
error,
});

onError(error, connection, request);
});

connection.socket.on("message", async (message, isBinary) => {
logger({
service: "websocket",
level: "info",
message: `Websocket message received`,
data: message,
});

onMessage(connection, request);
});

connection.socket.on("close", () => {
logger({
service: "websocket",
level: "info",
message: `Websocket connection closed`,
});

onClose(connection, request);
// clearTimeout(timeout);
});
},
});
Expand Down
3 changes: 2 additions & 1 deletion src/utils/cache/authWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export const getAuthWallet = async (): Promise<LocalWallet> => {
logger({
service: "server",
level: "info",
message: `[Encryption] Updating authWalletEncryptedJson to use ENCRYPTION_PASSWORD`,
message:
"[Encryption] Updating authWalletEncryptedJson to use ENCRYPTION_PASSWORD",
});

await updateConfiguration({
Expand Down
2 changes: 1 addition & 1 deletion src/utils/redis/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ redis.on("error", (error) => () => {
});
redis.on("ready", () => {
logger({
level: "info",
level: "debug",
message: "Redis ready",
service: "worker",
});
Expand Down
13 changes: 3 additions & 10 deletions src/worker/tasks/mineTransactionWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ const handler: Processor<any, void, string> = async (job: Job<string>) => {
walletAddress: getAddress(resultTransaction.from),
},
});
logger({
level: "info",
queueId: resultTransaction.queueId,
message: `Transaction mined [${resultTransaction.transactionHash}]`,
service: "worker",
});
}
};

Expand Down Expand Up @@ -180,10 +174,9 @@ const _mineTransaction = async (
const blockNumber = await getBlockNumberish(chainId);
const ellapsedBlocks = blockNumber - sentAtBlock;
if (ellapsedBlocks >= config.minEllapsedBlocksBeforeRetry) {
const message = `Resending transaction after ${ellapsedBlocks} blocks. blockNumber=${blockNumber} sentAtBlock=${sentAtBlock}`;
job.log(message);
logger({ service: "worker", level: "info", queueId, message });

job.log(
`Resending transaction after ${ellapsedBlocks} blocks. blockNumber=${blockNumber} sentAtBlock=${sentAtBlock}`,
);
await SendTransactionQueue.add({
queueId,
resendCount: resendCount + 1,
Expand Down
2 changes: 1 addition & 1 deletion src/worker/tasks/nonceHealthCheckWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const handler: Processor<null, void, string> = async (_job: Job<null>) => {

logger({
service: "worker",
level: isStuck ? "fatal" : "info",
level: isStuck ? "fatal" : "debug",
message: `[WALLET_HEALTH] ${walletAddress}:${chainId} isStuck:${isStuck} onchainNonce:${currentState.onchainNonce} largestSentNonce:${currentState.largestSentNonce}`,
});
}),
Expand Down

0 comments on commit 844d297

Please sign in to comment.