@@ -19,15 +19,15 @@ use std::{collections::BTreeMap, fmt::Debug, str::FromStr};
1919
2020use bytesize:: ByteSize ;
2121use frame_try_runtime:: UpgradeCheckSelect ;
22- use paris :: formatter :: colorize_string ;
22+ use log :: Level ;
2323use parity_scale_codec:: Encode ;
2424use sc_executor:: sp_wasm_interface:: HostFunctions ;
2525use sp_core:: { hexdisplay:: HexDisplay , Hasher } ;
2626use sp_runtime:: traits:: { Block as BlockT , HashingFor , NumberFor } ;
2727use sp_state_machine:: { CompactProof , OverlayedChanges , StorageProof } ;
2828
2929use crate :: {
30- build_executor,
30+ build_executor, misc ,
3131 state:: { RuntimeChecks , State } ,
3232 state_machine_call_with_proof, RefTimeInfo , SharedParams , LOG_TARGET ,
3333} ;
@@ -106,24 +106,13 @@ where
106106 }
107107
108108 // Run `TryRuntime_on_runtime_upgrade` with the given checks.
109- log:: info!(
110- "{}" ,
111- colorize_string(
112- "<bold><blue>-------------------------------------------------------------------\n \n "
113- )
114- ) ;
115- log:: info!(
116- "{}" ,
117- colorize_string( format!(
118- "🔬 <bold><blue>Running TryRuntime_on_runtime_upgrade with checks: {:?}\n \n " ,
109+ misc:: basti_log (
110+ Level :: Info ,
111+ format ! (
112+ "🔬 Running TryRuntime_on_runtime_upgrade with checks: {:?}" ,
119113 command. checks
120- ) )
121- ) ;
122- log:: info!(
123- "{}" ,
124- colorize_string(
125- "<bold><blue>-------------------------------------------------------------------"
126114 )
115+ . as_str ( ) ,
127116 ) ;
128117 // Save the overlayed changes from the first run, so we can use them later for idempotency
129118 // checks.
@@ -146,17 +135,9 @@ where
146135 let ( proof, ref_time_results) = match command. checks {
147136 UpgradeCheckSelect :: None => ( proof, ref_time_results) ,
148137 _ => {
149- log:: info!(
150- "{}" ,
151- colorize_string( "<bold><blue>-------------------------------------------------------------------\n \n " )
152- ) ;
153- log:: info!(
154- "{}" ,
155- colorize_string( "🔬 <bold><blue>TryRuntime_on_runtime_upgrade succeeded! Running it again without checks for weight measurements.\n \n " ) ,
156- ) ;
157- log:: info!(
158- "{}" ,
159- colorize_string( "<bold><blue>-------------------------------------------------------------------" )
138+ misc:: basti_log (
139+ Level :: Info ,
140+ "🔬 TryRuntime_on_runtime_upgrade succeeded! Running it again without checks for weight measurements." ,
160141 ) ;
161142 let ( proof, encoded_result) = state_machine_call_with_proof :: < Block , HostFns > (
162143 & ext,
@@ -179,17 +160,13 @@ where
179160 true
180161 }
181162 false => {
182- log:: info!(
183- "{}" ,
184- colorize_string( "<bold><blue>-------------------------------------------------------------------\n \n " )
185- ) ;
186- log:: info!(
187- "{}" ,
188- colorize_string( format!( "🔬 <bold><blue>Running TryRuntime_on_runtime_upgrade again to check idempotency: {:?}\n \n " , command. checks) ) ,
189- ) ;
190- log:: info!(
191- "{}" ,
192- colorize_string( "<bold><blue>-------------------------------------------------------------------" )
163+ misc:: basti_log (
164+ Level :: Info ,
165+ format ! (
166+ "🔬 Running TryRuntime_on_runtime_upgrade again to check idempotency: {:?}" ,
167+ command. checks
168+ )
169+ . as_str ( ) ,
193170 ) ;
194171 let ( oc_pre_root, _) = overlayed_changes. storage_root ( & ext. backend , ext. state_version ) ;
195172 overlayed_changes. start_transaction ( ) ;
@@ -267,19 +244,9 @@ where
267244 } ;
268245
269246 if !weight_ok || !idempotency_ok {
270- log:: error!(
271- "{}" ,
272- colorize_string( "<bold><red>-------------------------------------------------------------------\n \n " )
273- ) ;
274- log:: error!(
275- "{}" ,
276- colorize_string( "❌ <bold><red>Issues detected, exiting non-zero. See logs.\n \n " ) ,
277- ) ;
278- log:: error!(
279- "{}" ,
280- colorize_string(
281- "<bold><red>-------------------------------------------------------------------"
282- )
247+ misc:: basti_log (
248+ Level :: Error ,
249+ "❌ Issues detected, exiting non-zero. See logs." ,
283250 ) ;
284251 std:: process:: exit ( 1 ) ;
285252 }
0 commit comments