From 6d4e09a959d7aa4e2a9e00b5efb3593b3e3b4046 Mon Sep 17 00:00:00 2001 From: Mariano Goldman Date: Mon, 1 Jul 2024 17:46:15 -0300 Subject: [PATCH] better logging --- content/src/service/validations/validator.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/src/service/validations/validator.ts b/content/src/service/validations/validator.ts index c41c44b8d..4618b2810 100644 --- a/content/src/service/validations/validator.ts +++ b/content/src/service/validations/validator.ts @@ -80,6 +80,7 @@ export async function createOnChainValidator( l2Provider: HTTPProvider ): Promise { const { env, metrics, logs, externalCalls } = components + const logger = logs.getLogger('OnChainValidator') const l1Network: 'mainnet' | 'sepolia' = env.getConfig(EnvironmentConfig.ETH_NETWORK) const l2Network = l1Network === 'mainnet' ? 'polygon' : 'amoy' @@ -119,9 +120,9 @@ export async function createOnChainValidator( const file = `blocks-cache-${networkName}.csv` try { await loadTree(tree, file, converter) - console.log(`loading snapshot for ${networkName} took ${new Date().getTime() - start} ms.`) + logger.debug(`loading snapshot for ${networkName} took ${new Date().getTime() - start} ms.`) } catch (e) { - console.log(`failed to load cache file ${file}`, e.toString()) + logger.warn(`failed to load cache file ${file}`, e.toString()) } } await warmUpCache(l1BlockSearch.tree, l1Network)