mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 01:18:21 +00:00
use xdg convention for log file location putting it in .cache (see #27)
This commit is contained in:
parent
aa1c54d366
commit
39479c5d13
2 changed files with 8 additions and 3 deletions
|
|
@ -63,11 +63,16 @@ cargo install gitui
|
|||
|
||||
# diagnostics:
|
||||
|
||||
to enable logging to `~/.gitui/gitui.log`:
|
||||
to enable logging:
|
||||
```
|
||||
GITUI_LOGGING=true gitui
|
||||
```
|
||||
|
||||
this will log to:
|
||||
* `$HOME/Library/Caches/gitui/gitui.log` (mac)
|
||||
* `$XDG_CACHE_HOME/gitui/gitui.log` (linux using `XDG`)
|
||||
* `$HOME/.cache/gitui/gitui.log` (linux)
|
||||
|
||||
# inspiration
|
||||
|
||||
* https://github.com/jesseduffield/lazygit
|
||||
|
|
|
|||
|
|
@ -152,8 +152,8 @@ fn start_terminal<W: Write>(
|
|||
|
||||
fn setup_logging() {
|
||||
if env::var("GITUI_LOGGING").is_ok() {
|
||||
let mut path = dirs::home_dir().unwrap();
|
||||
path.push(".gitui");
|
||||
let mut path = dirs::cache_dir().unwrap();
|
||||
path.push("gitui");
|
||||
path.push("gitui.log");
|
||||
fs::create_dir(path.parent().unwrap()).unwrap_or_default();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue