Skip to content

Commit

Permalink
Should be done
Browse files Browse the repository at this point in the history
  • Loading branch information
ReCore-sys committed Sep 16, 2024
1 parent 50bb2fd commit 0f525af
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/utils/logging/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ edition = "2021"
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
tokio = "1.40.0"

profiling = { path = "../profiling" }
14 changes: 12 additions & 2 deletions src/utils/logging/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
use profiling::ProfilerTracingLayer;
use tracing::Level;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;

static LOG_LEVEL: Level = Level::INFO;

pub async fn init_logging() {
pub fn init_logging() {
let env_filter =
tracing_subscriber::EnvFilter::from_default_env().add_directive(LOG_LEVEL.into());

tracing_subscriber::fmt().with_env_filter(env_filter).init();
let fmt_layer = tracing_subscriber::fmt::Layer::default();

let profiler_layer = ProfilerTracingLayer::default();
tracing_subscriber::registry()
.with(env_filter)
.with(profiler_layer)
.with(fmt_layer)
.init();
}
3 changes: 1 addition & 2 deletions src/utils/profiling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ lazy_static = "1.5.0"
hashbrown = "0.14.5"
dashmap = "6.1.0"
parking_lot = "0.12.3"
tracing-subscriber = "0.3.18"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
tracing = "0.1.40"
tinyvec = "1.8.0"
serde = "1.0.210"
serde_json = "1.0.128"
serde_derive = "1.0.210"

logging = { path = "../logging" }
log = "0.4.22"
tokio = { version = "1.40.0", features = ["full"] }
derive_macros = { path = "../../derive_macros" }

0 comments on commit 0f525af

Please sign in to comment.