Merge pull request #84 from idanarye/use-log-instead-of-println

Use `error!`/`warn!` logs instead of `println!`
This commit is contained in:
daa84 2018-04-01 22:03:42 +03:00 committed by GitHub
commit e67e03605d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
); );