Skip to content

Commit

Permalink
feat: Use logger to output log
Browse files Browse the repository at this point in the history
  • Loading branch information
wenty22 committed Jan 22, 2025
1 parent 8242e53 commit 4faf703
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class TokenSchedule implements OnModuleInit {
);
}

@Cron(CronExpression.EVERY_5_MINUTES)
@Cron(CronExpression.EVERY_MINUTE)
async syncCoingeckoTokenPrice() {
this.logger.log('syncCoingeckoTokenPrice');
const { tokens, keyMap } = await this.tokensService.getLlamaTokenIdsForPriceJob();
Expand Down
19 changes: 12 additions & 7 deletions apps/canonical-bridge-server/src/shared/web3/web3.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class Web3Service {
);
return data;
} catch (e) {
console.error(`Failed to retrieve cBridge data at ${new Date().getTime()}`, e.message);
this.logger.log(`Failed to retrieve cBridge data at ${new Date().getTime()}, ${e.message}`);
}
}

Expand All @@ -80,7 +80,10 @@ export class Web3Service {

return data;
} catch (e) {
console.error(`Failed to retrieve DeBridge chain data at ${new Date().getTime()}`, e.message);
this.logger.log(
`Failed to retrieve DeBridge chain data at ${new Date().getTime()},
${e.message}`,
);
}
}

Expand All @@ -92,9 +95,9 @@ export class Web3Service {

return data;
} catch (e) {
console.error(
`Failed to retrieve DeBridge token data from ${chainId} at ${new Date().getTime()}`,
e.message,
this.logger.log(
`Failed to retrieve DeBridge token data from ${chainId} at ${new Date().getTime()},
${e.message}`,
);
}
}
Expand All @@ -120,7 +123,9 @@ export class Web3Service {
});
return processedTokenList;
} catch (e) {
console.error(`Failed to retrieve Stargate API data at ${new Date().getTime()}`, e.message);
this.logger.log(
`Failed to retrieve Stargate API data at ${new Date().getTime()}, ${e.message}`,
);
}
}

Expand All @@ -131,7 +136,7 @@ export class Web3Service {
);
return data;
} catch (e) {
console.log(`Failed to retrieve Meson API data at ${new Date().getTime()}`, e);
this.logger.log(`Failed to retrieve Meson API data at ${new Date().getTime()}, ${e}`);
return [];
}
}
Expand Down

0 comments on commit 4faf703

Please sign in to comment.