Logging setup

This commit is contained in:
veeso
2021-05-16 10:36:16 +02:00
parent 8c9c331d7e
commit 4e287a0231
9 changed files with 200 additions and 0 deletions

View File

@@ -87,6 +87,15 @@ pub fn get_config_paths(config_dir: &Path) -> (PathBuf, PathBuf) {
(bookmarks_file, keys_dir)
}
/// ### get_log_paths
///
/// Returns the path for the supposed log file
pub fn get_log_paths(config_dir: &Path) -> PathBuf {
let mut log_file: PathBuf = PathBuf::from(config_dir);
log_file.push("termscp.log");
log_file
}
#[cfg(test)]
mod tests {
@@ -143,4 +152,12 @@ mod tests {
)
);
}
#[test]
fn test_system_environment_get_log_paths() {
assert_eq!(
get_log_paths(&Path::new("/home/omar/.config/termscp/")),
PathBuf::from("/home/omar/.config/termscp/termscp.log"),
);
}
}