Skip to content

Commit

Permalink
chore: rename parameter 'filter' to 'level' in 'init_log_level' (#4403)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves #3879

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
michaeljklein authored Feb 22, 2024
1 parent b5e5c30 commit 292a972
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ pub struct BuildInfo {
}

#[wasm_bindgen]
pub fn init_log_level(filter: String) {
pub fn init_log_level(level: String) {
// Set the static variable from Rust
use std::sync::Once;

let filter: EnvFilter =
filter.parse().expect("Could not parse log filter while initializing logger");
let level_filter: EnvFilter =
level.parse().expect("Could not parse log filter while initializing logger");

static SET_HOOK: Once = Once::new();
SET_HOOK.call_once(|| {
Expand All @@ -46,7 +46,7 @@ pub fn init_log_level(filter: String) {
.without_time()
.with_writer(MakeWebConsoleWriter::new());

tracing_subscriber::registry().with(fmt_layer.with_filter(filter)).init();
tracing_subscriber::registry().with(fmt_layer.with_filter(level_filter)).init();
});
}

Expand Down

0 comments on commit 292a972

Please sign in to comment.