Skip to content

Commit

Permalink
Add useful logging defaults for debugging web content on android.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdm committed Sep 26, 2018
1 parent 854a4bd commit 38d3f59
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions ports/libsimpleservo/src/jniapi.rs
Expand Up @@ -64,11 +64,19 @@ pub fn Java_com_mozilla_servoview_JNIServo_init(
// Note: Android debug logs are stripped from a release build.
// debug!() will only show in a debug build. Use info!() if logs
// should show up in adb logcat with a release build.
let mut filter = Filter::default()
.with_min_level(Level::Debug)
.with_allowed_module_path("simpleservo::api")
.with_allowed_module_path("simpleservo::jniapi")
.with_allowed_module_path("simpleservo::gl_glue::egl");
let filters = [
"simpleservo::api",
"simpleservo::jniapi",
"simpleservo::gl_glue::egl",
// Show JS errors by default.
"script::dom::bindings::error",
// Show GL errors by default.
"canvas::webgl_thread",
];
let mut filter = Filter::default().with_min_level(Level::Debug);
for &module in &filters {
filter = filter.with_allowed_module_path(module);
}
let log_str = env.get_string(log_str).ok();
let log_str = log_str.as_ref().map_or(Cow::Borrowed(""), |s| s.to_string_lossy());
for module in log_str.split(',') {
Expand Down

0 comments on commit 38d3f59

Please sign in to comment.