Skip to content

Commit d5e8812

Browse files
Integrate with feature non-blocking-tracing of common-rs (#144)
* Integrates with feature `non-blocking-tracing` of `common-rs`, it could also fix the issue of log output out-of-sync. * Removes dependency `env_logger`. * Update .env Co-authored-by: HAOYUatHZ <[email protected]>
1 parent 13ab688 commit d5e8812

File tree

4 files changed

+109
-52
lines changed

4 files changed

+109
-52
lines changed

Cargo.lock

Lines changed: 104 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ coins-bip32 = "0.3"
1313
config_rs = { package = "config", version = "0.10.1" }
1414
crossbeam-channel = "0.5.1"
1515
dotenv = "0.15.0"
16-
env_logger = "0.5"
1716
ethers = { git = "https://github.com/gakonst/ethers-rs" }
18-
fluidex-common = { git = "https://github.com/Fluidex/common-rs", branch = "master", features = [ "kafka", "rollup-state-db" ] }
17+
fluidex-common = { git = "https://github.com/Fluidex/common-rs", branch = "master", features = [ "kafka", "non-blocking-tracing", "rollup-state-db" ] }
1918
futures = "0.3.13"
2019
hex = "0.4.3"
2120
lazy_static = "1.4.0"

src/bin/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use fluidex_common::db::{
99
},
1010
MIGRATOR,
1111
};
12+
use fluidex_common::non_blocking_tracing;
1213
use rollup_state_manager::config::Settings;
1314
use rollup_state_manager::grpc::run_grpc_server;
1415
use rollup_state_manager::msg::{msg_loader, msg_processor};
@@ -27,7 +28,7 @@ use std::{fs, io};
2728
#[tokio::main]
2829
async fn main() -> anyhow::Result<()> {
2930
dotenv::dotenv().ok();
30-
env_logger::init();
31+
let _guard = non_blocking_tracing::setup();
3132
log::info!("state_keeper started");
3233

3334
Settings::init_default();

tests/circuit_tests/export_testcases.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use fluidex_common::non_blocking_tracing;
12
use rollup_state_manager::test_utils::circuit;
23
use std::fs;
34
use std::path::PathBuf;
@@ -19,7 +20,7 @@ fn run() -> anyhow::Result<()> {
1920

2021
fn main() {
2122
dotenv::dotenv().ok();
22-
env_logger::init();
23+
let _guard = non_blocking_tracing::setup();
2324
Settings::init_default();
2425
log::debug!("{:?}", Settings::get());
2526
match run() {

0 commit comments

Comments
 (0)