mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
ohos: Add default log filter (#32760)
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
This commit is contained in:
parent
496ce717c5
commit
b206a0f4a3
3 changed files with 19 additions and 0 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -5794,6 +5794,7 @@ dependencies = [
|
|||
"egui",
|
||||
"egui-winit",
|
||||
"egui_glow",
|
||||
"env_filter",
|
||||
"euclid",
|
||||
"getopts",
|
||||
"gilrs",
|
||||
|
|
|
@ -77,6 +77,7 @@ webxr = { git = "https://github.com/servo/webxr" }
|
|||
backtrace = { workspace = true }
|
||||
|
||||
[target.'cfg(target_env = "ohos")'.dependencies]
|
||||
env_filter = "0.1.0"
|
||||
# force inprocess, until libc-rs 0.2.156 is released containing
|
||||
# https://github.com/rust-lang/libc/commit/9e248e212c5602cb4e98676e4c21ea0382663a12
|
||||
ipc-channel = { workspace = true, features = ["force-inprocess"] }
|
||||
|
|
|
@ -325,6 +325,23 @@ fn initialize_logging_once() {
|
|||
static ONCE: Once = Once::new();
|
||||
ONCE.call_once(|| {
|
||||
let mut builder = hilog::Builder::new();
|
||||
let filters = [
|
||||
"fonts",
|
||||
"servo",
|
||||
"servoshell",
|
||||
"servoshell::egl:gl_glue",
|
||||
// Show JS errors by default.
|
||||
"script::dom::bindings::error",
|
||||
// Show GL errors by default.
|
||||
"canvas::webgl_thread",
|
||||
"compositing::compositor",
|
||||
"constellation::constellation",
|
||||
];
|
||||
let mut filter_builder = env_filter::Builder::new();
|
||||
for &module in &filters {
|
||||
filter_builder.filter_module(module, log::LevelFilter::Debug);
|
||||
}
|
||||
|
||||
builder.filter_level(LevelFilter::Debug).init();
|
||||
|
||||
info!("Servo Register callback called!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue