Use error!/warn! logs instead of println!

This commit is contained in:
Idan Arye 2018-04-01 20:12:52 +03:00
parent 0ff34d0cbe
commit 31c1f2c949
3 changed files with 7 additions and 7 deletions

View File

@ -439,7 +439,7 @@ impl EntryStore {
entries.insert(0, Entry::new_current_project(pwd)); entries.insert(0, Entry::new_current_project(pwd));
} }
} else { } else {
println!("Error get current directory"); error!("Error get current directory");
} }
} }
err @ Err(_) => err.report_err(), err @ Err(_) => err.report_err(),

View File

@ -122,7 +122,7 @@ pub trait SettingsLoader: Sized + serde::Serialize {
match load_err() { match load_err() {
Ok(settings) => settings, Ok(settings) => settings,
Err(e) => { Err(e) => {
println!("{}", e); error!("{}", e);
Self::empty() Self::empty()
} }
} }

View File

@ -18,7 +18,7 @@ pub fn can_close_window(comps: &UiMutex<Components>, shell: &RefCell<Shell>) ->
} }
} }
Err(ref err) => { Err(ref err) => {
println!("Error getting info from nvim: {}", err); error!("Error getting info from nvim: {}", err);
true true
} }
} }
@ -58,7 +58,7 @@ fn show_not_saved_dlg(comps: &UiMutex<Components>, shell: &Shell, changed_bufs:
let mut nvim = state.nvim().unwrap(); let mut nvim = state.nvim().unwrap();
match nvim.command("wa") { match nvim.command("wa") {
Err(ref err) => { Err(ref err) => {
println!("Error: {}", err); error!("Error: {}", err);
false false
} }
_ => true, _ => true,
@ -87,11 +87,11 @@ fn get_changed_buffers(shell: &Shell) -> Result<Vec<String>, CallError> {
match buf.get_option(&mut nvim, "modified") { match buf.get_option(&mut nvim, "modified") {
Ok(Value::Boolean(val)) => val, Ok(Value::Boolean(val)) => val,
Ok(_) => { Ok(_) => {
println!("Value must be boolean"); warn!("Value must be boolean");
false false
} }
Err(ref err) => { Err(ref err) => {
println!( error!(
"Something going wrong while getting buffer option: {}", "Something going wrong while getting buffer option: {}",
err err
); );
@ -101,7 +101,7 @@ fn get_changed_buffers(shell: &Shell) -> Result<Vec<String>, CallError> {
match buf.get_name(&mut nvim) { match buf.get_name(&mut nvim) {
Ok(name) => name, Ok(name) => name,
Err(ref err) => { Err(ref err) => {
println!( error!(
"Something going wrong while getting buffer name: {}", "Something going wrong while getting buffer name: {}",
err err
); );