Skip to content

Commit

Permalink
Output logs to LocalAppData instead of AppData
Browse files Browse the repository at this point in the history
  • Loading branch information
samhocevar committed May 11, 2021
1 parent d73c809 commit 9bd8a45
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/wincompose/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static void Init()
var file_target = new FileTarget("File")
{
Layout = log_fmt,
FileName = Path.Combine(Utils.AppDataDir, "wincompose.log"),
FileName = Path.Combine(Utils.LocalAppDataDir, "wincompose.log"),
ConcurrentWrites = true,
ArchiveEvery = FileArchivePeriod.Day,
EnableArchiveFileCompression = true,
Expand Down
11 changes: 11 additions & 0 deletions src/wincompose/misc/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ public static string AppDataDir
}
}

public static string LocalAppDataDir
{
get
{
var localappdata = Environment.SpecialFolder.LocalApplicationData;
var localappdatadir = Path.Combine(Environment.GetFolderPath(localappdata),
"WinCompose");
return IsInstalled ? localappdatadir : ExecutableDir;
}
}

public static string DataDir
=> Path.Combine(ExecutableDir, IsInstalled ? "res" :
IsDebugging ? "../../rules" : "rules");
Expand Down

0 comments on commit 9bd8a45

Please sign in to comment.