diff --git a/backend/src/api/blocks.ts b/backend/src/api/blocks.ts index eee5dae6e..4d7e4e2a8 100644 --- a/backend/src/api/blocks.ts +++ b/backend/src/api/blocks.ts @@ -410,12 +410,13 @@ class Blocks { try { // Get all indexed block hash const unindexedBlockHeights = await blocksRepository.$getCPFPUnindexedBlocks(); - logger.info(`Indexing cpfp data for ${unindexedBlockHeights.length} blocks`); if (!unindexedBlockHeights?.length) { return; } + logger.info(`Indexing cpfp data for ${unindexedBlockHeights.length} blocks`); + // Logging let count = 0; let countThisRun = 0; @@ -616,7 +617,7 @@ class Blocks { priceId: lastestPriceId, }]); } else { - logger.info(`Cannot save block price for ${blockExtended.height} because the price updater hasnt completed yet. Trying again in 10 seconds.`, logger.tags.mining); + logger.debug(`Cannot save block price for ${blockExtended.height} because the price updater hasnt completed yet. Trying again in 10 seconds.`, logger.tags.mining); setTimeout(() => { indexer.runSingleTask('blocksPrices'); }, 10000); diff --git a/backend/src/api/disk-cache.ts b/backend/src/api/disk-cache.ts index 0ec502c08..c50d3cef8 100644 --- a/backend/src/api/disk-cache.ts +++ b/backend/src/api/disk-cache.ts @@ -164,7 +164,7 @@ class DiskCache { } } } catch (e) { - logger.info('Error parsing ' + fileName + '. Skipping. Reason: ' + (e instanceof Error ? e.message : e)); + logger.err('Error parsing ' + fileName + '. Skipping. Reason: ' + (e instanceof Error ? e.message : e)); } } diff --git a/backend/src/api/mining/mining.ts b/backend/src/api/mining/mining.ts index 58626df65..27ac426bd 100644 --- a/backend/src/api/mining/mining.ts +++ b/backend/src/api/mining/mining.ts @@ -452,7 +452,7 @@ class Mining { const elapsedSeconds = Math.max(1, Math.round((new Date().getTime() / 1000) - timer)); if (elapsedSeconds > 5) { const progress = Math.round(totalBlockChecked / blocks.length * 100); - logger.info(`Indexing difficulty adjustment at block #${block.height} | Progress: ${progress}%`, logger.tags.mining); + logger.debug(`Indexing difficulty adjustment at block #${block.height} | Progress: ${progress}%`, logger.tags.mining); timer = new Date().getTime() / 1000; } } @@ -558,8 +558,10 @@ class Mining { currentBlockHeight -= 10000; } - if (totalIndexed) { - logger.info(`Indexing missing coinstatsindex data completed`, logger.tags.mining); + if (totalIndexed > 0) { + logger.info(`Indexing missing coinstatsindex data completed. Indexed ${totalIndexed}`, logger.tags.mining); + } else { + logger.debug(`Indexing missing coinstatsindex data completed. Indexed 0.`, logger.tags.mining); } } diff --git a/backend/src/tasks/lightning/forensics.service.ts b/backend/src/tasks/lightning/forensics.service.ts index c62639411..7837cb4d5 100644 --- a/backend/src/tasks/lightning/forensics.service.ts +++ b/backend/src/tasks/lightning/forensics.service.ts @@ -27,7 +27,7 @@ class ForensicsService { private async $runTasks(): Promise { try { - logger.info(`Running forensics scans`); + logger.debug(`Running forensics scans`); if (config.MEMPOOL.BACKEND === 'esplora') { await this.$runClosedChannelsForensics(false); @@ -73,7 +73,7 @@ class ForensicsService { let progress = 0; try { - logger.info(`Started running closed channel forensics...`); + logger.debug(`Started running closed channel forensics...`); let channels; if (onlyNewChannels) { channels = await channelsApi.$getClosedChannelsWithoutReason(); @@ -156,7 +156,7 @@ class ForensicsService { this.loggerTimer = new Date().getTime() / 1000; } } - logger.info(`Closed channels forensics scan complete.`); + logger.debug(`Closed channels forensics scan complete.`); } catch (e) { logger.err('$runClosedChannelsForensics() error: ' + (e instanceof Error ? e.message : e)); } @@ -217,7 +217,7 @@ class ForensicsService { let progress = 0; try { - logger.info(`Started running open channel forensics...`); + logger.debug(`Started running open channel forensics...`); const channels = await channelsApi.$getChannelsWithoutSourceChecked(); for (const openChannel of channels) { @@ -266,7 +266,7 @@ class ForensicsService { } } - logger.info(`Open channels forensics scan complete.`); + logger.debug(`Open channels forensics scan complete.`); } catch (e) { logger.err('$runOpenedChannelsForensics() error: ' + (e instanceof Error ? e.message : e)); } finally { diff --git a/backend/src/tasks/lightning/network-sync.service.ts b/backend/src/tasks/lightning/network-sync.service.ts index 3e5ae1366..28f60bbf9 100644 --- a/backend/src/tasks/lightning/network-sync.service.ts +++ b/backend/src/tasks/lightning/network-sync.service.ts @@ -283,7 +283,7 @@ class NetworkSyncService { } else { log += ` for the first time`; } - logger.info(`${log}`, logger.tags.ln); + logger.debug(`${log}`, logger.tags.ln); const channels = await channelsApi.$getChannelsByStatus([0, 1]); for (const channel of channels) { diff --git a/backend/src/tasks/pools-updater.ts b/backend/src/tasks/pools-updater.ts index fb86d03be..b24da124e 100644 --- a/backend/src/tasks/pools-updater.ts +++ b/backend/src/tasks/pools-updater.ts @@ -62,7 +62,7 @@ class PoolsUpdater { if (this.currentSha === null) { logger.info(`Downloading pools-v2.json for the first time from ${this.poolsUrl} over ${network}`, logger.tags.mining); } else { - logger.warn(`pools-v2.json is outdated, fetch latest from ${this.poolsUrl} over ${network}`, logger.tags.mining); + logger.warn(`pools-v2.json is outdated, fetching latest from ${this.poolsUrl} over ${network}`, logger.tags.mining); } const poolsJson = await this.query(this.poolsUrl); if (poolsJson === undefined) { diff --git a/backend/src/tasks/price-updater.ts b/backend/src/tasks/price-updater.ts index 716ac9ee6..3b9dad30e 100644 --- a/backend/src/tasks/price-updater.ts +++ b/backend/src/tasks/price-updater.ts @@ -222,7 +222,7 @@ class PriceUpdater { private async $insertMissingRecentPrices(type: 'hour' | 'day'): Promise { const existingPriceTimes = await PricesRepository.$getPricesTimes(); - logger.info(`Fetching ${type === 'day' ? 'dai' : 'hour'}ly price history from exchanges and saving missing ones into the database`, logger.tags.mining); + logger.debug(`Fetching ${type === 'day' ? 'dai' : 'hour'}ly price history from exchanges and saving missing ones into the database`, logger.tags.mining); const historicalPrices: PriceHistory[] = [];