@@ -235,6 +235,7 @@ void get_mapping::update( T *res )
235235 // check and get any new product accounts in mapping table
236236 num_sym_ = tab->num_ ;
237237 PC_LOG_INF ( " add_mapping" )
238+ .add ( " secondary" , cptr->is_secondary () )
238239 .add ( " account" , mkey_ )
239240 .add ( " num_products" , num_sym_ )
240241 .end ();
@@ -381,6 +382,7 @@ void product::update( T *res )
381382 net_buf *jhd, *jtl;
382383 wtr.detach ( jhd, jtl );
383384 PC_LOG_INF ( st_ != e_done ? " add_product" : " upd_product" )
385+ .add ( " secondary" , cptr->is_secondary () )
384386 .add ( " account" , acc_ )
385387 .add ( " attr" , str ( jhd->buf_ , jhd->size_ ) )
386388 .end ();
@@ -691,6 +693,7 @@ bool price::update(
691693 tvec_.emplace_back ( std::string ( 100 , ' \0 ' ), preq_->get_sent_time () );
692694 preq_->get_signature ()->enc_base58 ( tvec_.back ().first );
693695 PC_LOG_DBG ( " sent price update transaction" )
696+ .add ( " secondary" , mgr->is_secondary () )
694697 .add ( " price_account" , *get_account () )
695698 .add ( " product_account" , *prod_->get_account () )
696699 .add ( " symbol" , get_symbol () )
@@ -700,6 +703,7 @@ bool price::update(
700703 .end ();
701704 if ( PC_UNLIKELY ( tvec_.size () >= 100 ) ) {
702705 PC_LOG_WRN ( " too many unacked price update transactions" )
706+ .add ( " secondary" , mgr->is_secondary () )
703707 .add ( " price_account" , *get_account () )
704708 .add ( " product_account" , *prod_->get_account () )
705709 .add ( " symbol" , get_symbol () )
@@ -732,8 +736,10 @@ bool price::send( price *prices[], const unsigned n )
732736 // Build an upd_price rpc request for every price
733737 for ( unsigned i = 0 , j = 0 ; i < n; ++i ) {
734738 price *const p = prices[ i ];
739+ manager *const mgr = p->get_manager ();
735740 if ( PC_UNLIKELY ( ! p->init_ && ! p->init_publish () ) ) {
736741 PC_LOG_ERR ( " failed to initialize publisher" )
742+ .add ( " secondary" , mgr->is_secondary () )
737743 .add ( " price_account" , *p->get_account () )
738744 .add ( " product_account" , *p->prod_ ->get_account () )
739745 .add ( " symbol" , p->get_symbol () )
@@ -742,6 +748,7 @@ bool price::send( price *prices[], const unsigned n )
742748 }
743749 if ( PC_UNLIKELY ( ! p->has_publisher () ) ) {
744750 PC_LOG_ERR ( " missing publish permission" )
751+ .add ( " secondary" , mgr->is_secondary () )
745752 .add ( " price_account" , *p->get_account () )
746753 .add ( " product_account" , *p->prod_ ->get_account () )
747754 .add ( " symbol" , p->get_symbol () )
@@ -750,18 +757,20 @@ bool price::send( price *prices[], const unsigned n )
750757 }
751758 if ( PC_UNLIKELY ( ! p->get_is_ready_publish () ) ) {
752759 PC_LOG_ERR ( " not ready to publish - check rpc / pyth_tx connection" )
760+ .add ( " secondary" , mgr->is_secondary () )
753761 .add ( " price_account" , *p->get_account () )
754762 .add ( " product_account" , *p->prod_ ->get_account () )
755763 .add ( " symbol" , p->get_symbol () )
756764 .add ( " price_type" , price_type_to_str ( p->get_price_type () ) ).end ();
757765 continue ;
758766 }
759- manager * const mgr = p-> get_manager ();
767+
760768 if ( ! mgr1 ) {
761769 mgr1 = mgr;
762770 }
763771 else if ( mgr != mgr1 ) {
764772 PC_LOG_ERR ( " unexpected manager" )
773+ .add ( " secondary" , mgr->is_secondary () )
765774 .add ( " price_account" , *p->get_account () )
766775 .add ( " product_account" , *p->prod_ ->get_account () )
767776 .add ( " symbol" , p->get_symbol () )
@@ -786,6 +795,7 @@ bool price::send( price *prices[], const unsigned n )
786795 }
787796 else {
788797 PC_LOG_ERR ( " failed to build msg" )
798+ .add ( " secondary" , mgr->is_secondary () )
789799 .add ( " price_account" , *p->get_account () )
790800 .add ( " product_account" , *p->prod_ ->get_account () )
791801 .add ( " symbol" , p->get_symbol () )
@@ -801,6 +811,7 @@ bool price::send( price *prices[], const unsigned n )
801811 );
802812 p1->preq_ ->get_signature ()->enc_base58 ( p1->tvec_ .back ().first );
803813 PC_LOG_DBG ( " sent price update" )
814+ .add ( " secondary" , mgr->is_secondary () )
804815 .add ( " price_account" , *p1->get_account () )
805816 .add ( " product_account" , *p1->prod_ ->get_account () )
806817 .add ( " symbol" , p1->get_symbol () )
@@ -810,6 +821,7 @@ bool price::send( price *prices[], const unsigned n )
810821 .end ();
811822 if ( PC_UNLIKELY ( p1->tvec_ .size () >= 100 ) ) {
812823 PC_LOG_WRN ( " too many unacked price update transactions" )
824+ .add ( " secondary" , mgr->is_secondary () )
813825 .add ( " price_account" , *p1->get_account () )
814826 .add ( " product_account" , *p1->prod_ ->get_account () )
815827 .add ( " symbol" , p1->get_symbol () )
@@ -860,6 +872,7 @@ void price::on_response( rpc::upd_price *res )
860872 const int64_t ack_dur = res->get_recv_time () - it->second ;
861873 tvec_.erase ( it );
862874 PC_LOG_DBG ( " received price update transaction ack" )
875+ .add ( " secondary" , get_manager ()->is_secondary () )
863876 .add ( " price_account" , *get_account () )
864877 .add ( " product_account" , *prod_->get_account () )
865878 .add ( " symbol" , get_symbol () )
@@ -885,6 +898,7 @@ void price::on_response( rpc::account_update *res )
885898void price::log_update ( const char *title )
886899{
887900 PC_LOG_INF ( title )
901+ .add ( " secondary" , get_manager ()->is_secondary () )
888902 .add ( " account" , *get_account () )
889903 .add ( " product" , *prod_->get_account () )
890904 .add ( " symbol" , get_symbol () )
0 commit comments