Skip to content

Commit 91e1f13

Browse files
committed
feat: added missing logs pattern to errors and logs
1 parent 18e674a commit 91e1f13

File tree

77 files changed

+463
-530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+463
-530
lines changed

indexer/src/cache/init.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ export default async function initCache(context: ResolverContext) {
2626
};
2727
MEMORY_CACHE.set(HASH_RATE_AND_TOTAL_DIFFICULTY_KEY, newValue);
2828
} catch (err) {
29-
console.log('Error getting hash rate and total difficulty', err);
29+
console.error(
30+
'[ERROR][CACHE][CONN_TIMEOUT] Failed to get hash rate and total difficulty',
31+
err,
32+
);
3033
}
3134
}
3235

@@ -35,7 +38,7 @@ export default async function initCache(context: ResolverContext) {
3538
const networkStatistics = await networkRepository.getNetworkStatistics();
3639
MEMORY_CACHE.set(NETWORK_STATISTICS_KEY, networkStatistics);
3740
} catch (err) {
38-
console.log('Error getting network statistics', err);
41+
console.error('[ERROR][CACHE][CONN_TIMEOUT] Failed to get network statistics', err);
3942
}
4043
}
4144

@@ -44,7 +47,7 @@ export default async function initCache(context: ResolverContext) {
4447
const nodeInfo = await networkRepository.getNodeInfo();
4548
MEMORY_CACHE.set(NODE_INFO_KEY, nodeInfo);
4649
} catch (err) {
47-
console.log('Error getting node info', err);
50+
console.error('[ERROR][CACHE][CONN_TIMEOUT] Failed to get node info', err);
4851
}
4952
}
5053

indexer/src/config/database.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ export const sequelize = new Sequelize(
5656
export async function closeDatabase(): Promise<void> {
5757
try {
5858
await sequelize.close();
59-
console.log('Connection has been closed successfully.');
59+
console.info('[INFO][DB][CONN] Database connection closed successfully.');
6060
} catch (error) {
61-
console.error('Unable to close the connection:', error);
61+
console.error('[ERROR][DB][CONN_LOST] Failed to close database connection:', error);
6262
throw error;
6363
}
6464
}

0 commit comments

Comments
 (0)