Skip to content

Commit

Permalink
Refactor log conditions for Solana transactions
Browse files Browse the repository at this point in the history
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'.
  • Loading branch information
wkennedy committed Oct 18, 2024
1 parent 0a7357e commit d9fe28b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wasm-example/parseable-winston-example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});

Expand Down

0 comments on commit d9fe28b

Please sign in to comment.