Skip to content

Commit

Permalink
Backed out changeset bba5c678e394 (bug 1874215) for causing xpchsell …
Browse files Browse the repository at this point in the history
…failures on test_register_app_services_logger.js. CLOSED TREE
  • Loading branch information
Iulian Moraru committed Jan 23, 2024
1 parent 774e0dd commit 3b94aae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions services/common/app_services_logger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ extern crate cstr;
extern crate xpcom;

use golden_gate::log::LogSink;
use log;
use nserror::{nsresult, NS_OK};
use nsstring::nsAString;
use once_cell::sync::Lazy;
use std::os::raw::c_char;
use std::{
cmp,
collections::HashMap,
sync::{
atomic::{AtomicBool, Ordering},
Expand Down Expand Up @@ -44,6 +46,11 @@ impl AppServicesLogger {
xpcom_method!(register => Register(target: *const nsAString, logger: *const mozIServicesLogSink));
fn register(&self, target: &nsAString, logger: &mozIServicesLogSink) -> Result<(), nsresult> {
let log_sink_logger = LogSink::with_logger(Some(logger))?;
let max_level = cmp::max(log::max_level(), log_sink_logger.max_level);

// Note: This will only work if the max_level is lower than the compile-time
// max_level_* filter.
log::set_max_level(max_level);

ensure_observing_shutdown();

Expand Down

0 comments on commit 3b94aae

Please sign in to comment.