-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50bb2fd
commit 0f525af
Showing
3 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters