Remove logging to log.txt

This commit is contained in:
a-kenji 2021-03-16 21:34:50 +01:00
parent 564ded0bb3
commit 224c606b45
2 changed files with 1 additions and 10 deletions

View file

@ -6,7 +6,6 @@ use std::io::{self, Read};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use super::keybinds::{Keybinds, KeybindsFromYaml}; use super::keybinds::{Keybinds, KeybindsFromYaml};
use crate::utils::logging::*;
use directories_next::ProjectDirs; use directories_next::ProjectDirs;
use serde::Deserialize; use serde::Deserialize;
@ -49,8 +48,6 @@ impl Config {
} }
/// Deserializes from given path. /// Deserializes from given path.
/// The allow is here, because rust assumes there is no
/// error handling when logging the error to the log file.
#[allow(unused_must_use)] #[allow(unused_must_use)]
pub fn new(path: &Path) -> Result<Config, ConfigError> { pub fn new(path: &Path) -> Result<Config, ConfigError> {
match File::open(path) { match File::open(path) {
@ -60,11 +57,7 @@ impl Config {
.map_err(|e| ConfigError::IoPath(e, path.to_path_buf()))?; .map_err(|e| ConfigError::IoPath(e, path.to_path_buf()))?;
Ok(Config::from_yaml(&yaml_config)?) Ok(Config::from_yaml(&yaml_config)?)
} }
Err(e) => { Err(_) => {
debug_log_to_file(format!(
"{}\nUsing the default configuration!",
ConfigError::IoPath(e, path.to_path_buf())
));
Ok(Config::default()) Ok(Config::default())
} }
} }

View file

@ -28,7 +28,6 @@ use wasmer_wasi::{Pipe, WasiState};
use crate::cli::CliArgs; use crate::cli::CliArgs;
use crate::common::input::config::Config; use crate::common::input::config::Config;
use crate::layout::Layout; use crate::layout::Layout;
use crate::utils::logging::*;
use command_is_executing::CommandIsExecuting; use command_is_executing::CommandIsExecuting;
use errors::{AppContext, ContextType, ErrorContext, PluginContext, PtyContext, ScreenContext}; use errors::{AppContext, ContextType, ErrorContext, PluginContext, PtyContext, ScreenContext};
use input::handler::input_loop; use input::handler::input_loop;
@ -173,7 +172,6 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
#[allow(unused_must_use)] #[allow(unused_must_use)]
let config = Config::from_option_or_default(opts.config) let config = Config::from_option_or_default(opts.config)
.map_err(|e| { .map_err(|e| {
debug_log_to_file(format!("There was an error in the config file:\n{}", e));
eprintln!("There was an error in the config file:\n{}", e); eprintln!("There was an error in the config file:\n{}", e);
std::process::exit(1); std::process::exit(1);
}) })