Skip to content

Commit 5271fbd

Browse files
committed
removed redundant logs
1 parent c3c8373 commit 5271fbd

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

src/indexer/pangea_event_handler.rs

+14-20
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use chrono::Utc;
55
use prometheus::{register_int_counter, IntCounter};
66
use serde::{Deserialize, Serialize};
77
use std::sync::Arc;
8-
use tracing::{info, error, warn};
8+
use tracing::{debug, error, warn};
99

1010
lazy_static::lazy_static! {
1111
static ref PROCESSED_ORDERS_TOTAL: IntCounter = register_int_counter!(
@@ -43,7 +43,7 @@ pub async fn handle_order_event(
4343
event: PangeaOrderEvent,
4444
) {
4545
if let Some(ref et) = event.event_type {
46-
info!(
46+
debug!(
4747
target: "pangea_events",
4848
">> handle_order_event: event_type = {:?}, order_id = {}, block = {}, tx = {}, log_index = {}",
4949
et,
@@ -53,7 +53,7 @@ pub async fn handle_order_event(
5353
event.log_index
5454
);
5555
} else {
56-
info!(
56+
debug!(
5757
target: "pangea_events",
5858
">> handle_order_event: NO event_type, order_id = {}, block = {}, tx = {}, log_index = {}",
5959
event.order_id,
@@ -67,12 +67,12 @@ pub async fn handle_order_event(
6767
match event_type {
6868
"Open" => {
6969
if let Some(order) = create_new_order_from_event(&event) {
70-
info!(
70+
debug!(
7171
">> Adding new order to order_book: id = {}, amount = {}, price = {}, limit_type = {:?}",
7272
order.id, order.amount, order.price, order.limit_type
7373
);
7474
order_book.add_order(order);
75-
info!("🟢 New order added (id: {})", event.order_id);
75+
debug!("🟢 New order added (id: {})", event.order_id);
7676
} else {
7777
warn!(
7878
"Open event received but could not create SpotOrder (fields missing?) for order_id = {}",
@@ -82,15 +82,15 @@ pub async fn handle_order_event(
8282
}
8383
"Trade" => {
8484
matching_orders.remove(&event.order_id);
85-
info!(
85+
debug!(
8686
"🔄 Order {} removed from matching_orders (Trade event)",
8787
&event.order_id
8888
);
8989
if let Some(match_size) = event.amount {
9090
let o_type = event.order_type_to_enum();
9191
let l_type = event.limit_type_to_enum();
9292

93-
info!(
93+
debug!(
9494
">> process_trade called. event_tx_id = {:?}, order_id = {}, match_size = {}, order_type = {:?}, limit_type = {:?}",
9595
event.transaction_hash, event.order_id, match_size, o_type, l_type
9696
);
@@ -105,12 +105,12 @@ pub async fn handle_order_event(
105105
}
106106
"Cancel" => {
107107
matching_orders.remove(&event.order_id);
108-
info!(
108+
debug!(
109109
"🔄 Order {} removed from matching_orders (Cancel event)",
110110
&event.order_id
111111
);
112112
order_book.remove_order(&event.order_id, event.order_type_to_enum());
113-
info!(
113+
debug!(
114114
"Removed order with id: {} due to Cancel event",
115115
event.order_id
116116
);
@@ -172,15 +172,10 @@ pub fn process_trade(
172172
}
173173
};
174174

175-
info!(
176-
"process_trade START: order_id = {}, trade_amount = {}, order_type = {:?}, limit_type = {:?}",
177-
order_id, trade_amount, order_type, limit_type
178-
);
179-
180175
match limit_type {
181176
LimitType::GTC | LimitType::MKT => {
182177
if let Some(mut order) = order_book.get_order(order_id, order_type) {
183-
info!(
178+
debug!(
184179
">> Found order in order_book: id = {}, current_amount = {}, status = {:?}",
185180
order.id, order.amount, order.status
186181
);
@@ -190,15 +185,15 @@ pub fn process_trade(
190185
order.status = Some(OrderStatus::PartiallyMatched);
191186
order_book.update_order(order.clone());
192187

193-
info!(
188+
debug!(
194189
"🟡 Order {} partially matched. Trade amount: {}, remaining amount: {}",
195190
order_id, trade_amount, order.amount
196191
);
197192
} else {
198193
order.status = Some(OrderStatus::Matched);
199194
order_book.remove_order(order_id, Some(order_type));
200195

201-
info!(
196+
debug!(
202197
"✅ Order {} fully matched and removed. Trade amount: {}, previous amount: {}",
203198
order_id,
204199
trade_amount,
@@ -211,15 +206,14 @@ pub fn process_trade(
211206
}
212207
LimitType::FOK | LimitType::IOC => {
213208
order_book.remove_order(order_id, Some(order_type));
214-
info!(
209+
debug!(
215210
"🗑️ Order {} removed (FOK/IOC). trade_amount = {}",
216211
order_id, trade_amount
217212
);
218213
}
219214
}
220215

221-
// Дополнительный лог, когда выходим
222-
info!(
216+
debug!(
223217
"process_trade END: order_id = {}, limit_type = {:?}",
224218
order_id, limit_type
225219
);

0 commit comments

Comments
 (0)