Commit 66e2e97
authored
fix(dirs): restore /log subdirectory in log path after appdirs migration (#565)
* fix(dirs): restore /log subdirectory in log path after appdirs migration
PR #562 replaced `appdirs` with `dirs` for Windows ARM64 compatibility,
but `dirs` has no `log_dir()` equivalent to `appdirs::user_log_dir()`.
The migration used `dirs::cache_dir()` directly, dropping the /log
component from log paths.
This caused logs to be written to the wrong location:
Before: ~/.cache/activitywatch/log/{module}/
After: ~/.cache/activitywatch/{module}/ (WRONG)
Fix by adding a platform-specific `get_user_log_dir()` helper that
replicates the old `appdirs::user_log_dir("activitywatch")` behavior:
- Linux: ~/.cache/activitywatch/log/
- macOS: ~/Library/Logs/activitywatch/
- Windows: {LOCALAPPDATA}\activitywatch\Logs\
Also adds a regression test to prevent this from happening again.
* style: run cargo fmt1 parent c455da9 commit 66e2e97
1 file changed
Lines changed: 62 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 63 | + | |
67 | 64 | | |
68 | 65 | | |
69 | 66 | | |
70 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
71 | 99 | | |
72 | 100 | | |
73 | 101 | | |
| |||
99 | 127 | | |
100 | 128 | | |
101 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
0 commit comments