Conversation
add optional verbose logging
WalkthroughThe PR exports logging configuration types to the public API and gates debug logging across protocol activation strategies with a verbose logging flag to control log output without changing functional behavior. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (23)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull Request Overview
This PR adds conditional logging based on the KdfLoggingConfig.verboseLogging flag to reduce log noise in production. The change wraps existing debug log statements in various activation strategy classes with verbose logging checks.
- Introduces
KdfLoggingConfigclass with averboseLoggingstatic flag - Wraps debug log statements in activation strategies with conditional checks
- Exports
KdfLoggingConfigfrom the framework package
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| komodo_defi_framework.dart | Exports the new KdfLoggingConfig class |
| zhtlc_activation_strategy.dart | Wraps ZHTLC activation debug logs with verbose logging checks |
| utxo_activation_strategy.dart | Wraps UTXO/Electrum activation debug logs with verbose logging checks |
| tendermint_activation_strategy.dart | Wraps Tendermint activation debug logs with verbose logging checks |
| qtum_activation_strategy.dart | Wraps QTUM activation debug logs with verbose logging checks |
| eth_with_tokens_activation_strategy.dart | Wraps ETH platform activation debug logs with verbose logging checks |
| eth_task_activation_strategy.dart | Wraps ETH task-based activation debug logs with verbose logging checks |
| erc20_activation_strategy.dart | Wraps ERC20 token activation debug logs with verbose logging checks |
| custom_erc20_activation_strategy.dart | Wraps custom ERC20 token activation debug logs with verbose logging checks |
| bch_activation_strategy.dart | Wraps BCH and SLP token activation debug logs with verbose logging checks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( | ||
| '[RPC] Activating ZHTLC coin: ${asset.id.id}', | ||
| name: 'ZhtlcActivationStrategy', | ||
| ); | ||
| log( | ||
| } | ||
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( | ||
| '[RPC] Activation parameters: ${jsonEncode({'ticker': asset.id.id, 'protocol': asset.protocol.subClass.formatted, 'activation_params': params.toRpcParams(), 'zcash_params_path': userConfig.zcashParamsPath, 'scan_blocks_per_iteration': userConfig.scanBlocksPerIteration, 'scan_interval_ms': userConfig.scanIntervalMs, 'polling_interval_ms': effectivePollingInterval.inMilliseconds, 'priv_key_policy': privKeyPolicy.toJson()})}', | ||
| name: 'ZhtlcActivationStrategy', | ||
| ); | ||
| } |
There was a problem hiding this comment.
Two consecutive log statements are wrapped in separate if (KdfLoggingConfig.verboseLogging) blocks. These should be combined into a single conditional block to reduce redundancy and improve readability.
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( | ||
| '[RPC] Activating Tendermint platform: ${asset.id.id}', | ||
| name: 'TendermintWithTokensActivationStrategy', | ||
| ); | ||
| log( | ||
| } | ||
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( | ||
| '[RPC] Activation parameters: ${jsonEncode({ |
There was a problem hiding this comment.
Two consecutive log statements are wrapped in separate if (KdfLoggingConfig.verboseLogging) blocks. These should be combined into a single conditional block to reduce redundancy and improve readability.
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( | ||
| '[RPC] Activating QTUM coin: ${asset.id.id}', | ||
| name: 'QtumActivationStrategy', | ||
| ); | ||
| log( | ||
| } | ||
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( | ||
| '[RPC] Activation parameters: ${jsonEncode({ |
There was a problem hiding this comment.
Two consecutive log statements are wrapped in separate if (KdfLoggingConfig.verboseLogging) blocks. These should be combined into a single conditional block to reduce redundancy and improve readability.
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( | ||
| '[RPC] Activating ETH platform: ${asset.id.id}', | ||
| name: 'EthWithTokensActivationStrategy', | ||
| ); | ||
| log( | ||
| } | ||
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( | ||
| '[RPC] Activation parameters: ${jsonEncode({'ticker': asset.id.id, 'protocol': asset.protocol.subClass.formatted, 'token_count': children?.length ?? 0, 'tokens': children?.map((e) => e.id.id).toList() ?? [], 'activation_params': activationParams.toRpcParams(), 'priv_key_policy': privKeyPolicy.toJson()})}', | ||
| name: 'EthWithTokensActivationStrategy', | ||
| ); | ||
| } |
There was a problem hiding this comment.
Two consecutive log statements are wrapped in separate if (KdfLoggingConfig.verboseLogging) blocks. These should be combined into a single conditional block to reduce redundancy and improve readability.
|
Visit the preview URL for this PR (updated for commit 0cdff3c): https://komodo-playground--pr279-dev-vfaqs1cf.web.app (expires Sat, 08 Nov 2025 21:04:04 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 2bfedd77fdea45b25ba7c784416e81f177aa5c47 |
Summary by CodeRabbit
New Features
Improvements