Skip to content

Commit

Permalink
Add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Avery committed Aug 12, 2024
1 parent b51a1fe commit 2da01df
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crates/bitwarden-wasm/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::rc::Rc;
use argon2::{Algorithm, Argon2, Params, Version};
use bitwarden_json::client::Client as JsonClient;
use js_sys::Promise;
use log::Level;
use log::{warn, Level};
use wasm_bindgen::prelude::*;
use wasm_bindgen_futures::future_to_promise;

Expand Down Expand Up @@ -37,9 +37,11 @@ impl BitwardenClient {
#[wasm_bindgen(constructor)]
pub fn new(settings_input: Option<String>, log_level: Option<LogLevel>) -> Self {
console_error_panic_hook::set_once();
// This will only fail if another logger was already initialized, so we can ignore the
// result.
let _ = console_log::init_with_level(convert_level(log_level.unwrap_or(LogLevel::Info)));
if let Err(_e) =

Check warning on line 40 in crates/bitwarden-wasm/src/client.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-wasm/src/client.rs#L40

Added line #L40 was not covered by tests
console_log::init_with_level(convert_level(log_level.unwrap_or(LogLevel::Info)))
{
warn!("Logger already initialized, log level will not be changed.");

Check warning on line 43 in crates/bitwarden-wasm/src/client.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-wasm/src/client.rs#L43

Added line #L43 was not covered by tests
}

Self(Rc::new(bitwarden_json::client::Client::new(settings_input)))
}
Expand Down

0 comments on commit 2da01df

Please sign in to comment.