@@ -446,8 +446,10 @@ bool Account::unpack(Ref<vm::CellSlice> shard_account, ton::UnixTime now, bool s
446446 return false ;
447447 }
448448 if (verbosity > 2 ) {
449- shard_account->print_rec (std::cerr, 2 );
450- block::gen::t_ShardAccount.print (std::cerr, *shard_account);
449+ FLOG (INFO) {
450+ shard_account->print_rec (sb, 2 );
451+ block::gen::t_ShardAccount.print (sb, shard_account);
452+ };
451453 }
452454 block::gen::ShardAccount::Record acc_info;
453455 if (!(block::tlb::t_ShardAccount.validate_csr (shard_account) && tlb::unpack_exact (shard_account.write (), acc_info))) {
@@ -737,9 +739,11 @@ bool Transaction::unpack_input_msg(bool ihr_delivered, const ActionPhaseConfig*
737739 return false ;
738740 }
739741 if (verbosity > 2 ) {
740- fprintf (stderr, " unpacking inbound message for a new transaction: " );
741- block::gen::t_Message_Any.print_ref (std::cerr, in_msg);
742- load_cell_slice (in_msg).print_rec (std::cerr);
742+ FLOG (INFO) {
743+ sb << " unpacking inbound message for a new transaction: " ;
744+ block::gen::t_Message_Any.print_ref (sb, in_msg);
745+ load_cell_slice (in_msg).print_rec (sb);
746+ };
743747 }
744748 auto cs = vm::load_cell_slice (in_msg);
745749 int tag = block::gen::t_CommonMsgInfo.get_tag (cs);
@@ -1550,11 +1554,13 @@ bool Transaction::run_precompiled_contract(const ComputePhaseConfig& cfg, precom
15501554 cp.actions = impl.get_c5 ();
15511555 int out_act_num = output_actions_count (cp.actions );
15521556 if (verbosity > 2 ) {
1553- std::cerr << " new smart contract data: " ;
1554- bool can_be_special = true ;
1555- load_cell_slice_special (cp.new_data , can_be_special).print_rec (std::cerr);
1556- std::cerr << " output actions: " ;
1557- block::gen::OutList{out_act_num}.print_ref (std::cerr, cp.actions );
1557+ FLOG (INFO) {
1558+ sb << " new smart contract data: " ;
1559+ bool can_be_special = true ;
1560+ load_cell_slice_special (cp.new_data , can_be_special).print_rec (sb);
1561+ sb << " output actions: " ;
1562+ block::gen::OutList{out_act_num}.print_ref (sb, cp.actions );
1563+ };
15581564 }
15591565 }
15601566 cp.mode = 0 ;
@@ -1619,7 +1625,6 @@ bool Transaction::prepare_compute_phase(const ComputePhaseConfig& cfg) {
16191625 if (in_msg_state.not_null ()) {
16201626 LOG (DEBUG) << " HASH(in_msg_state) = " << in_msg_state->get_hash ().bits ().to_hex (256 )
16211627 << " , account_state_hash = " << account.state_hash .to_hex ();
1622- // vm::load_cell_slice(in_msg_state).print_rec(std::cerr);
16231628 } else {
16241629 LOG (DEBUG) << " in_msg_state is null" ;
16251630 }
@@ -1775,11 +1780,13 @@ bool Transaction::prepare_compute_phase(const ComputePhaseConfig& cfg) {
17751780 cp.actions = vm.get_committed_state ().c5 ; // c5 -> action list
17761781 int out_act_num = output_actions_count (cp.actions );
17771782 if (verbosity > 2 ) {
1778- std::cerr << " new smart contract data: " ;
1779- bool can_be_special = true ;
1780- load_cell_slice_special (cp.new_data , can_be_special).print_rec (std::cerr);
1781- std::cerr << " output actions: " ;
1782- block::gen::OutList{out_act_num}.print_ref (std::cerr, cp.actions );
1783+ FLOG (INFO) {
1784+ sb << " new smart contract data: " ;
1785+ bool can_be_special = true ;
1786+ load_cell_slice_special (cp.new_data , can_be_special).print_rec (sb);
1787+ sb << " output actions: " ;
1788+ block::gen::OutList{out_act_num}.print_ref (sb, cp.actions );
1789+ };
17831790 }
17841791 }
17851792 cp.mode = 0 ;
@@ -2725,14 +2732,18 @@ int Transaction::try_action_send_msg(const vm::CellSlice& cs0, ActionPhase& ap,
27252732 }
27262733 if (!block::gen::t_Message_Any.validate_ref (new_msg)) {
27272734 LOG (ERROR) << " generated outbound message is not a valid (Message Any) according to automated check" ;
2728- block::gen::t_Message_Any.print_ref (std::cerr, new_msg);
2729- vm::load_cell_slice (new_msg).print_rec (std::cerr);
2735+ FLOG (INFO) {
2736+ block::gen::t_Message_Any.print_ref (sb, new_msg);
2737+ vm::load_cell_slice (new_msg).print_rec (sb);
2738+ };
27302739 collect_fine ();
27312740 return -1 ;
27322741 }
27332742 if (verbosity > 2 ) {
2734- std::cerr << " converted outbound message: " ;
2735- block::gen::t_Message_Any.print_ref (std::cerr, new_msg);
2743+ FLOG (INFO) {
2744+ sb << " converted outbound message: " ;
2745+ block::gen::t_Message_Any.print_ref (sb, new_msg);
2746+ };
27362747 }
27372748
27382749 ap.msgs_created ++;
@@ -3045,8 +3056,10 @@ bool Transaction::prepare_bounce_phase(const ActionPhaseConfig& cfg) {
30453056 }
30463057 CHECK (cb.finalize_to (bp.out_msg ));
30473058 if (verbosity > 2 ) {
3048- LOG (INFO) << " generated bounced message: " ;
3049- block::gen::t_Message_Any.print_ref (std::cerr, bp.out_msg );
3059+ FLOG (INFO) {
3060+ sb << " generated bounced message: " ;
3061+ block::gen::t_Message_Any.print_ref (sb, bp.out_msg );
3062+ };
30503063 }
30513064 out_msgs.push_back (bp.out_msg );
30523065 bp.ok = true ;
@@ -3167,11 +3180,13 @@ bool Transaction::compute_state() {
31673180 auto frozen_state = cb2.finalize ();
31683181 frozen_hash = frozen_state->get_hash ().bits ();
31693182 if (verbosity >= 3 * 1 ) { // !!!DEBUG!!!
3170- std::cerr << " freezing state of smart contract: " ;
3171- block::gen::t_StateInit.print_ref (std::cerr, frozen_state);
3172- CHECK (block::gen::t_StateInit.validate_ref (frozen_state));
3173- CHECK (block::tlb::t_StateInit.validate_ref (frozen_state));
3174- std::cerr << " with hash " << frozen_hash.to_hex () << std::endl;
3183+ FLOG (INFO) {
3184+ sb << " freezing state of smart contract: " ;
3185+ block::gen::t_StateInit.print_ref (sb, frozen_state);
3186+ CHECK (block::gen::t_StateInit.validate_ref (frozen_state));
3187+ CHECK (block::tlb::t_StateInit.validate_ref (frozen_state));
3188+ sb << " with hash " << frozen_hash.to_hex ();
3189+ };
31753190 }
31763191 }
31773192 new_code.clear ();
@@ -3229,8 +3244,10 @@ bool Transaction::compute_state() {
32293244 CHECK (cb.append_data_cell_bool (std::move (storage)));
32303245 new_total_state = cb.finalize ();
32313246 if (verbosity > 2 ) {
3232- std::cerr << " new account state: " ;
3233- block::gen::t_Account.print_ref (std::cerr, new_total_state);
3247+ FLOG (INFO) {
3248+ sb << " new account state: " ;
3249+ block::gen::t_Account.print_ref (sb, new_total_state);
3250+ };
32343251 }
32353252 CHECK (block::tlb::t_Account.validate_ref (new_total_state));
32363253 return true ;
@@ -3322,22 +3339,28 @@ bool Transaction::serialize() {
33223339 return false ;
33233340 }
33243341 if (verbosity >= 3 * 1 ) {
3325- std::cerr << " new transaction: " ;
3326- block::gen::t_Transaction.print_ref (std::cerr, root);
3327- vm::load_cell_slice (root).print_rec (std::cerr);
3342+ FLOG (INFO) {
3343+ sb << " new transaction: " ;
3344+ block::gen::t_Transaction.print_ref (sb, root);
3345+ vm::load_cell_slice (root).print_rec (sb);
3346+ };
33283347 }
33293348
33303349 if (!block::gen::t_Transaction.validate_ref (4096 , root)) {
33313350 LOG (ERROR) << " newly-generated transaction failed to pass automated validation:" ;
3332- vm::load_cell_slice (root).print_rec (std::cerr);
3333- block::gen::t_Transaction.print_ref (std::cerr, root);
3351+ FLOG (INFO) {
3352+ vm::load_cell_slice (root).print_rec (sb);
3353+ block::gen::t_Transaction.print_ref (sb, root);
3354+ };
33343355 root.clear ();
33353356 return false ;
33363357 }
33373358 if (!block::tlb::t_Transaction.validate_ref (4096 , root)) {
33383359 LOG (ERROR) << " newly-generated transaction failed to pass hand-written validation:" ;
3339- vm::load_cell_slice (root).print_rec (std::cerr);
3340- block::gen::t_Transaction.print_ref (std::cerr, root);
3360+ FLOG (INFO) {
3361+ vm::load_cell_slice (root).print_rec (sb);
3362+ block::gen::t_Transaction.print_ref (sb, root);
3363+ };
33413364 root.clear ();
33423365 return false ;
33433366 }
0 commit comments