mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 01:18:21 +00:00
fix logging broken in d4455a2
This commit is contained in:
parent
e03ae0f931
commit
fce294066c
1 changed files with 10 additions and 1 deletions
11
src/args.rs
11
src/args.rs
|
|
@ -74,7 +74,7 @@ pub fn process_cmdline() -> Result<CliArgs> {
|
|||
}
|
||||
|
||||
fn setup_logging() -> Result<()> {
|
||||
let mut path = get_app_config_path()?;
|
||||
let mut path = get_app_cache_path()?;
|
||||
path.push("gitui.log");
|
||||
|
||||
let _ = WriteLogger::init(
|
||||
|
|
@ -86,6 +86,15 @@ fn setup_logging() -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn get_app_cache_path() -> Result<PathBuf> {
|
||||
let mut path = dirs_next::cache_dir()
|
||||
.ok_or_else(|| anyhow!("failed to find os cache dir."))?;
|
||||
|
||||
path.push("gitui");
|
||||
fs::create_dir_all(&path)?;
|
||||
Ok(path)
|
||||
}
|
||||
|
||||
pub fn get_app_config_path() -> Result<PathBuf> {
|
||||
let mut path = if cfg!(target_os = "macos") {
|
||||
dirs_next::home_dir().map(|h| h.join(".config"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue