Skip to content

Commit

Permalink
Migrate to tracing instead of log crate
Browse files Browse the repository at this point in the history
  • Loading branch information
farnyser committed Mar 25, 2024
1 parent 550473d commit 9cae769
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
17 changes: 8 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jsonrpc-core-client = { version = "18.0.0", features = ["ws", "http"] }

bs58 = "0.5"
base64 = "0.21.0"
log = "0.4"
tracing = "0.1.40"
rand = "0.7"
anyhow = "1.0"
toml = "0.5"
Expand Down
4 changes: 2 additions & 2 deletions connector/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mango-feeds-connector"
version = "0.2.1"
version = "0.2.2"
authors = ["Christian Kamm <[email protected]>"]
edition = "2021"
license = "AGPL-3.0-or-later"
Expand All @@ -27,7 +27,7 @@ rustls = { workspace = true }
serde = { workspace = true }
serde_derive = { workspace = true }

log = { workspace = true }
tracing = { workspace = true }
anyhow = { workspace = true }

itertools = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion connector/src/account_write_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use crate::{
};

use async_trait::async_trait;
use log::*;
use solana_sdk::{account::WritableAccount, pubkey::Pubkey, stake_history::Epoch};
use std::{
collections::{BTreeSet, HashMap},
sync::Arc,
time::{Duration, Instant},
};
use tracing::*;

#[async_trait]
pub trait AccountWriteSink {
Expand Down
2 changes: 1 addition & 1 deletion connector/src/grpc_plugin_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use yellowstone_grpc_proto::tonic::{
Request,
};

use log::*;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::{collections::HashMap, env, str::FromStr, time::Duration};
use tracing::*;
use yellowstone_grpc_proto::geyser::{
subscribe_request_filter_accounts_filter, subscribe_request_filter_accounts_filter_memcmp,
SubscribeRequestFilterAccountsFilter, SubscribeRequestFilterAccountsFilterMemcmp,
Expand Down
2 changes: 1 addition & 1 deletion connector/src/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use {
crate::MetricsConfig,
log::*,
std::collections::HashMap,
std::fmt,
std::sync::{atomic, Arc, Mutex, RwLock},
tokio::time,
tracing::*,
warp::{Filter, Rejection, Reply},
};

Expand Down
2 changes: 1 addition & 1 deletion connector/src/snapshot.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use jsonrpc_core_client::transports::http;
use log::*;
use solana_account_decoder::{UiAccount, UiAccountEncoding};
use solana_client::{
rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig},
Expand All @@ -8,6 +7,7 @@ use solana_client::{
use solana_rpc::rpc::rpc_accounts::AccountsDataClient;
use solana_rpc::rpc::rpc_accounts_scan::AccountsScanClient;
use solana_sdk::{commitment_config::CommitmentConfig, slot_history::Slot};
use tracing::*;

use crate::{AnyhowWrap, FeedFilterType};

Expand Down
4 changes: 2 additions & 2 deletions connector/src/websocket_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ use solana_sdk::{
};

use anyhow::Context;
use log::*;
use std::ops::Sub;
use std::{
str::FromStr,
sync::Arc,
time::{Duration, Instant},
};
use tokio::time::timeout;
use tracing::*;

use crate::snapshot::{
get_snapshot_gma, get_snapshot_gpa, SnapshotMultipleAccounts, SnapshotProgramAccounts,
Expand Down Expand Up @@ -363,7 +363,7 @@ pub async fn process_events(
.expect("send success");
}
WebsocketMessage::SnapshotUpdate((slot, accounts)) => {
trace!("snapshot update {slot}");
debug!("snapshot update {slot}");
let mut to_send = vec![];
for (pubkey, account) in accounts {
if let Some(account) = account {
Expand Down

0 comments on commit 9cae769

Please sign in to comment.