Skip to content

Commit 43fd171

Browse files
EmoSaruclaude
andcommitted
Move log files from Documents to local AppData to avoid OneDrive sync noise
Logs are high-churn diagnostic output, unlike settings/saves which live under Documents/EmoTracker. Writing them to LocalApplicationData keeps them out of both OneDrive's Documents backup and Windows roaming profile sync. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 9386be6 commit 43fd171

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

EmoTracker.Core/UserDirectory.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ public static bool IsDevMode
2323
get { return Instance.mbDev; }
2424
}
2525

26+
public static string LogPath
27+
{
28+
get
29+
{
30+
string localPath = IsDevMode ? System.IO.Path.Combine("EmoTracker", "dev") : "EmoTracker";
31+
return System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), localPath, "logs");
32+
}
33+
}
34+
2635
private bool CreateFolder(string path)
2736
{
2837
try

EmoTracker/App.axaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public override void OnFrameworkInitializationCompleted()
2525

2626
try
2727
{
28-
string logDirectory = Path.Combine(UserDirectory.Path, "logs");
28+
string logDirectory = UserDirectory.LogPath;
2929
Log.Logger = new LoggerConfiguration()
3030
.MinimumLevel.Verbose()
3131
.Enrich.FromLogContext()

0 commit comments

Comments
 (0)