Log critical errors with error! instead of println!
This commit is contained in:
parent
f14d24542c
commit
ab2db49af5
|
@ -32,7 +32,7 @@ use std::sync::Arc;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
use dirs;
|
use dirs;
|
||||||
use glutin::event_loop::EventLoop as GlutinEventLoop;
|
use glutin::event_loop::EventLoop as GlutinEventLoop;
|
||||||
use log::info;
|
use log::{error, info};
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use winapi::um::wincon::{AttachConsole, FreeConsole, ATTACH_PARENT_PROCESS};
|
use winapi::um::wincon::{AttachConsole, FreeConsole, ATTACH_PARENT_PROCESS};
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ fn main() {
|
||||||
|
|
||||||
// Run alacritty
|
// Run alacritty
|
||||||
if let Err(err) = run(window_event_loop, config) {
|
if let Err(err) = run(window_event_loop, config) {
|
||||||
println!("Alacritty encountered an unrecoverable error:\n\n\t{}\n", err);
|
error!("Alacritty encountered an unrecoverable error:\n\n\t{}\n", err);
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ use glutin::window::{CursorIcon, Fullscreen, Window as GlutinWindow, WindowBuild
|
||||||
use glutin::{self, ContextBuilder, PossiblyCurrent, WindowedContext};
|
use glutin::{self, ContextBuilder, PossiblyCurrent, WindowedContext};
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
use image::ImageFormat;
|
use image::ImageFormat;
|
||||||
|
use log::error;
|
||||||
#[cfg(not(any(target_os = "macos", windows)))]
|
#[cfg(not(any(target_os = "macos", windows)))]
|
||||||
use x11_dl::xlib::{Display as XDisplay, PropModeReplace, XErrorEvent, Xlib};
|
use x11_dl::xlib::{Display as XDisplay, PropModeReplace, XErrorEvent, Xlib};
|
||||||
|
|
||||||
|
@ -434,6 +435,6 @@ fn x_embed_window(window: &GlutinWindow, parent_id: c_ulong) {
|
||||||
|
|
||||||
#[cfg(not(any(target_os = "macos", windows)))]
|
#[cfg(not(any(target_os = "macos", windows)))]
|
||||||
unsafe extern "C" fn xembed_error_handler(_: *mut XDisplay, _: *mut XErrorEvent) -> i32 {
|
unsafe extern "C" fn xembed_error_handler(_: *mut XDisplay, _: *mut XErrorEvent) -> i32 {
|
||||||
println!("Could not embed into specified window.");
|
error!("Could not embed into specified window.");
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue