Skip to content

Commit f0e09c3

Browse files
authored
Remove external logs (#286)
1 parent 0213f8c commit f0e09c3

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

auction-server/src/main.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use {
1717
io::IsTerminal,
1818
time::Duration,
1919
},
20+
tracing::Metadata,
2021
tracing_subscriber::{
2122
filter::{
2223
self,
@@ -40,6 +41,10 @@ mod server;
4041
mod state;
4142
mod subwallet;
4243

44+
fn is_internal(metadata: &Metadata) -> bool {
45+
metadata.target().starts_with("auction_server")
46+
}
47+
4348
#[tokio::main]
4449
async fn main() -> Result<()> {
4550
// Initialize a Tracing Subscriber
@@ -71,7 +76,7 @@ async fn main() -> Result<()> {
7176
let registry = tracing_subscriber::registry()
7277
.with(MetricsLayer.with_filter(filter::filter_fn(is_metrics)))
7378
.with(telemetry.with_filter(filter::filter_fn(|metadata| {
74-
!is_metrics(metadata) && metadata.target().starts_with("auction_server")
79+
!is_metrics(metadata) && is_internal(metadata)
7580
})));
7681

7782
if std::io::stderr().is_terminal() {
@@ -80,7 +85,9 @@ async fn main() -> Result<()> {
8085
log_layer
8186
.compact()
8287
.with_filter(LevelFilter::INFO)
83-
.with_filter(filter::filter_fn(|metadata| !is_metrics(metadata))),
88+
.with_filter(filter::filter_fn(|metadata| {
89+
!is_metrics(metadata) && is_internal(metadata)
90+
})),
8491
)
8592
.init();
8693
} else {
@@ -89,7 +96,9 @@ async fn main() -> Result<()> {
8996
log_layer
9097
.json()
9198
.with_filter(LevelFilter::INFO)
92-
.with_filter(filter::filter_fn(|metadata| !is_metrics(metadata))),
99+
.with_filter(filter::filter_fn(|metadata| {
100+
!is_metrics(metadata) && is_internal(metadata)
101+
})),
93102
)
94103
.init();
95104
}

auction-server/src/opportunity/service/get_spoof_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl Service<ChainTypeEvm> {
3535
let result = find_spoof_info(input.token, Arc::new(config.provider.clone()))
3636
.await
3737
.unwrap_or_else(|e| {
38-
tracing::error!("Error finding spoof info: {:?}", e);
38+
tracing::warn!(error = ?e, "Couldn't find spoof info");
3939
entities::SpoofInfo {
4040
token: input.token,
4141
state: entities::SpoofState::UnableToSpoof,

auction-server/src/opportunity/service/handle_opportunity_bid.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ impl Service<ChainTypeEvm> {
109109
{
110110
Ok(bid) => Ok(bid.id),
111111
Err(e) => {
112-
tracing::error!(
112+
tracing::warn!(
113113
error = ?e,
114114
opportunity = ?opportunity,
115115
bid_create = ?bid_create,
116-
"Error handling bid",
116+
"Handling bid failed for opportunity_bid",
117117
);
118118
match e {
119119
RestError::SimulationError { result, reason } => {

0 commit comments

Comments
 (0)