diff --git a/prdoc/pr_4021.prdoc b/prdoc/pr_4021.prdoc new file mode 100644 index 0000000000000000000000000000000000000000..1f3a2748d133dd053292fd72ca4eb1d6c59a3664 --- /dev/null +++ b/prdoc/pr_4021.prdoc @@ -0,0 +1,13 @@ +# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 +# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json + +title: Improve log output for block imports + +doc: + - audience: Node Operator + description: | + Nodes now print the parent hash on import notification log messages. In addition, the emoji + of the log message indicates whether the block was imported as best block or not. "ðŸ†" is used for + best blocks, "🆕" for other imported blocks. + +crates: [ ] diff --git a/substrate/client/informant/src/lib.rs b/substrate/client/informant/src/lib.rs index 7db80bb2d972591aae5944cd1cafd5cba876ecbc..af778529ffc58e13736352265b74856477f597eb 100644 --- a/substrate/client/informant/src/lib.rs +++ b/substrate/client/informant/src/lib.rs @@ -187,10 +187,12 @@ where last_blocks.pop_front(); } + let best_indicator = if n.is_new_best { "ðŸ†" } else { "🆕" }; info!( target: "substrate", - "✨ Imported #{} ({})", + "{best_indicator} Imported #{} ({} → {})", format.print_with_color(Colour::White.bold(), n.header.number()), + n.header.parent_hash(), n.hash, ); }