hotfix(logging): let logging fail silently while testing
This commit is contained in:
parent
d3a38763cb
commit
61e8d09151
2 changed files with 7 additions and 7 deletions
|
|
@ -1261,7 +1261,9 @@ impl vte::Perform for Grid {
|
||||||
self.insert_character_at_cursor_position(EMPTY_TERMINAL_CHARACTER);
|
self.insert_character_at_cursor_position(EMPTY_TERMINAL_CHARACTER);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let _ = debug_log_to_file(format!("Unhandled csi: {}->{:?}", c, params));
|
let result = debug_log_to_file(format!("Unhandled csi: {}->{:?}", c, params));
|
||||||
|
#[cfg(not(test))]
|
||||||
|
result.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,12 @@ use std::{
|
||||||
use crate::os_input_output::set_permissions;
|
use crate::os_input_output::set_permissions;
|
||||||
use crate::utils::consts::{ZELLIJ_TMP_LOG_DIR, ZELLIJ_TMP_LOG_FILE};
|
use crate::utils::consts::{ZELLIJ_TMP_LOG_DIR, ZELLIJ_TMP_LOG_FILE};
|
||||||
|
|
||||||
pub fn atomic_create_file(file_name: &Path) {
|
pub fn atomic_create_file(file_name: &Path) -> io::Result<()> {
|
||||||
let _ = fs::OpenOptions::new()
|
let _ = fs::OpenOptions::new()
|
||||||
.append(true)
|
.append(true)
|
||||||
.create(true)
|
.create(true)
|
||||||
.open(file_name)
|
.open(file_name)?;
|
||||||
.unwrap();
|
set_permissions(file_name)
|
||||||
#[cfg(not(test))]
|
|
||||||
set_permissions(file_name).unwrap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn atomic_create_dir(dir_name: &Path) -> io::Result<()> {
|
pub fn atomic_create_dir(dir_name: &Path) -> io::Result<()> {
|
||||||
|
|
@ -42,7 +40,7 @@ pub fn debug_log_to_file(mut message: String) -> io::Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn debug_log_to_file_without_newline(message: String) -> io::Result<()> {
|
pub fn debug_log_to_file_without_newline(message: String) -> io::Result<()> {
|
||||||
atomic_create_file(&*ZELLIJ_TMP_LOG_FILE);
|
atomic_create_file(&*ZELLIJ_TMP_LOG_FILE)?;
|
||||||
let mut file = fs::OpenOptions::new()
|
let mut file = fs::OpenOptions::new()
|
||||||
.append(true)
|
.append(true)
|
||||||
.open(&*ZELLIJ_TMP_LOG_FILE)?;
|
.open(&*ZELLIJ_TMP_LOG_FILE)?;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue