From b7d3d7cfe2e6de4f94034ba9fa2a4041a87fdc67 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Wed, 5 Jun 2024 20:54:50 +0200 Subject: [PATCH] chore(cu): omit noisy/superfluous logs --- servers/cu/src/domain/client/ao-block.js | 2 +- servers/cu/src/domain/lib/loadMessageMeta.js | 2 +- servers/cu/src/domain/lib/loadMessages.js | 6 +----- servers/cu/src/domain/lib/loadProcess.js | 15 ++++++++------- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/servers/cu/src/domain/client/ao-block.js b/servers/cu/src/domain/client/ao-block.js index f5f747ed4..88bb38203 100644 --- a/servers/cu/src/domain/client/ao-block.js +++ b/servers/cu/src/domain/client/ao-block.js @@ -214,7 +214,7 @@ export function loadBlocksMetaWith ({ fetch, GRAPHQL_URL, pageSize, logger }) { */ timestamp: block.timestamp * 1000 }))) - .then(logger.tap('Loaded blocks meta after height %s up to timestamp %s', min, maxTimestamp)) + // .then(logger.tap('Loaded blocks meta after height %s up to timestamp %s', min, maxTimestamp)) )) .toPromise() } diff --git a/servers/cu/src/domain/lib/loadMessageMeta.js b/servers/cu/src/domain/lib/loadMessageMeta.js index 3c7a56503..2726bf13d 100644 --- a/servers/cu/src/domain/lib/loadMessageMeta.js +++ b/servers/cu/src/domain/lib/loadMessageMeta.js @@ -78,6 +78,6 @@ export function loadMessageMetaWith (env) { messageTxId: ctx.messageTxId })) .map(ctxSchema.parse) - .map(logger.tap('Loaded message process and timestamp and appended to ctx %j')) + // .map(logger.tap('Loaded message process and timestamp and appended to ctx %j')) } } diff --git a/servers/cu/src/domain/lib/loadMessages.js b/servers/cu/src/domain/lib/loadMessages.js index 100641f4b..1012ae17a 100644 --- a/servers/cu/src/domain/lib/loadMessages.js +++ b/servers/cu/src/domain/lib/loadMessages.js @@ -455,7 +455,7 @@ function loadCronMessagesWith ({ loadTimestamp, findBlocks, loadBlocksMeta, save */ rightMostTimestamp: ctx.to || currentBlock.timestamp })) - .map(logger.tap('reconciling blocks meta for scheduled messages in range of %o')) + // .map(logger.tap('reconciling blocks meta for scheduled messages in range of %o')) .chain(({ leftMost, rightMostTimestamp }) => reconcileBlocks({ min: leftMost.block.height, maxTimestamp: rightMostTimestamp }) .map(blocksMeta => { @@ -483,10 +483,6 @@ function loadCronMessagesWith ({ loadTimestamp, findBlocks, loadBlocksMeta, save } }) ) - .map(ctx => { - logger('Merging Streams of Scheduled and Cron Messages...') - return ctx - }) .map(({ leftMost, rightMostTimestamp, $scheduled, genCronMessages }) => { return composeStreams( $scheduled, diff --git a/servers/cu/src/domain/lib/loadProcess.js b/servers/cu/src/domain/lib/loadProcess.js index 67b4801b2..2ad89346b 100644 --- a/servers/cu/src/domain/lib/loadProcess.js +++ b/servers/cu/src/domain/lib/loadProcess.js @@ -1,5 +1,5 @@ import { Rejected, Resolved, fromPromise, of } from 'hyper-async' -import { always, identity, isNotNil, mergeRight, omit, pick } from 'ramda' +import { always, identity, isNotNil, mergeRight, pick } from 'ramda' import { z } from 'zod' import { findEvaluationSchema, findLatestProcessMemorySchema, findProcessSchema, isProcessOwnerSupportedSchema, loadProcessSchema, locateProcessSchema, saveLatestProcessMemorySchema, saveProcessSchema } from '../dal.js' @@ -113,7 +113,8 @@ function getProcessMetaWith ({ loadProcess, locateProcess, findProcess, saveProc */ .bimap( logger.tap('Could not find process in db. Loading from chain...'), - logger.tap('found process in db %j') + identity + // logger.tap('found process in db %j') ) /** * Locate the scheduler for the process and attach to context @@ -224,7 +225,7 @@ function loadLatestEvaluationWith ({ findEvaluation, findLatestProcessMemory, sa } function maybeCachedMemory (ctx) { - logger('Checking cache for existing memory to start evaluation "%s"...', ctx.id) + // logger('Checking cache for existing memory to start evaluation "%s"...', ctx.id) return findLatestProcessMemory({ processId: ctx.id, @@ -262,10 +263,10 @@ function loadLatestEvaluationWith ({ findEvaluation, findLatestProcessMemory, sa if (['cold_start'].includes(found.src)) return Resolved(found) if (['memory'].includes(found.src) && !found.fromFile) return Resolved(found) - logger( - 'Seeding cache with latest checkpoint found with parameters "%j"', - omit(['Memory'], found) - ) + // logger( + // 'Seeding cache with latest checkpoint found with parameters "%j"', + // omit(['Memory'], found) + // ) /** * Immediatley attempt to save the memory loaded from a checkpoint * into the LRU In-memory cache, which will cut