From d9fe28bd48441cd9a4d1ac21f30c0de82ba76609 Mon Sep 17 00:00:00 2001 From: waggins Date: Thu, 17 Oct 2024 20:08:40 -0400 Subject: [PATCH] Refactor log conditions for Solana transactions Change log message conditions to check for 'transaction_error' in Solana logs. Ensure errors are correctly logged with 'logger.error' and successful transactions are logged with 'logger.info'. --- wasm-example/parseable-winston-example/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wasm-example/parseable-winston-example/app.js b/wasm-example/parseable-winston-example/app.js index 2bc57c2..4533ec8 100644 --- a/wasm-example/parseable-winston-example/app.js +++ b/wasm-example/parseable-winston-example/app.js @@ -92,10 +92,10 @@ async function main() { solana: JSON.parse(sanitizeLogMessage(solana_log)) }; - if(err !== undefined && err != null) { - logger.info('Dev Solana logs', sanitizedLog); - } else { + if(sanitizedLog.solana.transaction_error !== null && sanitizedLog.solana.transaction_error !== "") { logger.error('Dev Solana logs', sanitizedLog); + } else { + logger.info('Dev Solana logs', sanitizedLog); } });