Remove the sources of some warnings, and log to stderr

This commit is contained in:
Daniel McNab 2022-06-19 14:01:08 +01:00
parent d9870b996c
commit fa82818711
3 changed files with 7 additions and 2 deletions

View File

@ -141,6 +141,7 @@ pub fn parse(key: &str) -> Vec<Self> {
"meta" => mods.set(Modifiers::META, true),
"shift" => mods.set(Modifiers::SHIFT, true),
"alt" => mods.set(Modifiers::ALT, true),
"" => (),
other => log::warn!("Invalid key modifier: {}", other),
}
}

View File

@ -38,14 +38,17 @@ pub fn launch() {
} else {
log::LevelFilter::Off
})
.level_for("piet_wgpu", log::LevelFilter::Info);
.chain(std::io::stderr());
if let Some(log_file) = Config::log_file().and_then(|f| fern::log_file(f).ok()) {
log_dispatch = log_dispatch.chain(log_file);
}
log_dispatch = override_log_levels(log_dispatch);
let _ = log_dispatch.apply();
match log_dispatch.apply() {
Ok(()) => (),
Err(e) => eprintln!("Initialising logging failed {e:?}"),
}
let mut launcher = AppLauncher::new().delegate(LapceAppDelegate::new());
let data = LapceData::load(launcher.get_external_handle());

View File

@ -1087,6 +1087,7 @@ fn layout(
data,
env,
);
child.widget.set_origin(ctx, data, env, next_origin);
let cross_size = self.direction.cross_size(size);
if cross_size > max_other_axis {
max_other_axis = cross_size;