mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
OHOS: Use new file logger. (#37690)
Hilog 0.2.1 allows us to additionally log to a file. This is sometimes more convinient when benchmarking. Also added the new log domain of `script::dom::console`. Testing: Tested on device. Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
parent
25a5f079ff
commit
6656a09f8c
5 changed files with 30 additions and 3 deletions
|
@ -507,6 +507,7 @@ static LOGGER: LazyLock<hilog::Logger> = LazyLock::new(|| {
|
|||
"servoshell::egl::log",
|
||||
// Show JS errors by default.
|
||||
"script::dom::bindings::error",
|
||||
"script::dom::console",
|
||||
// Show GL errors by default.
|
||||
"canvas::webgl_thread",
|
||||
"compositing::compositor",
|
||||
|
|
|
@ -152,6 +152,14 @@ pub fn init(
|
|||
},
|
||||
};
|
||||
|
||||
if servoshell_preferences.log_to_file {
|
||||
let mut servo_log = PathBuf::from(&native_values.cache_dir);
|
||||
servo_log.push("servo.log");
|
||||
if crate::egl::ohos::LOGGER.set_file_writer(servo_log).is_err() {
|
||||
warn!("Could not set log file");
|
||||
}
|
||||
}
|
||||
|
||||
crate::init_tracing(servoshell_preferences.tracing_filter.as_deref());
|
||||
#[cfg(target_env = "ohos")]
|
||||
crate::egl::ohos::set_log_filter(servoshell_preferences.log_filter.as_deref());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue