Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe PR exports Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes The changes follow a consistent, repetitive pattern across all strategy files: importing the framework package and wrapping existing debug logs with a verbose flag check. While nine files are affected, the homogeneous nature of the edits reduces cognitive load per file. Reviewers should verify that:
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (10)
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 conditionalizes verbose debug logging throughout the activation strategy files by wrapping log() calls with checks against KdfLoggingConfig.verboseLogging. This allows developers to reduce log noise by disabling verbose RPC logging when not needed.
Key changes:
- Added
KdfLoggingConfigexport to the komodo_defi_framework package - Wrapped all debug log statements in activation strategies with
if (KdfLoggingConfig.verboseLogging)checks - Updated 9 activation strategy files to conditionally log RPC activation details
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 |
|---|---|
| packages/komodo_defi_framework/lib/komodo_defi_framework.dart | Exports KdfLoggingConfig for use in SDK packages |
| packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/zhtlc_activation_strategy.dart | Wraps ZHTLC activation debug logs with verbose logging checks |
| packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/utxo_activation_strategy.dart | Wraps UTXO/Electrum activation debug logs with verbose logging checks |
| packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/tendermint_activation_strategy.dart | Wraps Tendermint activation debug logs with verbose logging checks |
| packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/qtum_activation_strategy.dart | Wraps QTUM activation debug logs with verbose logging checks |
| packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/eth_with_tokens_activation_strategy.dart | Wraps ETH platform activation debug logs with verbose logging checks |
| packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/eth_task_activation_strategy.dart | Wraps ETH task-based activation debug logs with verbose logging checks |
| packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/erc20_activation_strategy.dart | Wraps ERC20 token activation debug logs with verbose logging checks |
| packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/custom_erc20_activation_strategy.dart | Wraps custom ERC20 token activation debug logs with verbose logging checks |
| packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/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. Combine them into a single conditional block to avoid redundant condition checks.
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( | ||
| '[RPC] Activating Tendermint platform: ${asset.id.id}', | ||
| name: 'TendermintWithTokensActivationStrategy', | ||
| ); | ||
| log( | ||
| } | ||
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( |
There was a problem hiding this comment.
Two consecutive log statements are wrapped in separate if (KdfLoggingConfig.verboseLogging) blocks. Combine them into a single conditional block to avoid redundant condition checks.
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( | ||
| '[RPC] Activating QTUM coin: ${asset.id.id}', | ||
| name: 'QtumActivationStrategy', | ||
| ); | ||
| log( | ||
| } | ||
| if (KdfLoggingConfig.verboseLogging) { | ||
| log( |
There was a problem hiding this comment.
Two consecutive log statements are wrapped in separate if (KdfLoggingConfig.verboseLogging) blocks. Combine them into a single conditional block to avoid redundant condition checks.
| } | ||
| if (KdfLoggingConfig.verboseLogging) { |
There was a problem hiding this comment.
Two consecutive log statements are wrapped in separate if (KdfLoggingConfig.verboseLogging) blocks. Combine them into a single conditional block to avoid redundant condition checks.
| } | |
| if (KdfLoggingConfig.verboseLogging) { |
|
Visit the preview URL for this PR (updated for commit dbf0075): https://komodo-playground--pr278-optional-logging-85f1ddcg.web.app (expires Sat, 08 Nov 2025 20:42:52 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 2bfedd77fdea45b25ba7c784416e81f177aa5c47 |
|
Visit the preview URL for this PR (updated for commit dbf0075): https://kdf-sdk--pr278-optional-logging-uj69eled.web.app (expires Sat, 08 Nov 2025 20:42:52 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 9c1b6e6c010cf0b965c455ba7a69c4aedafa8a1d |
Summary by CodeRabbit
New Features
Chores