aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Headless.SDL2/Program.cs
diff options
context:
space:
mode:
authorjcm <john.moody@coloradocollege.edu>2024-02-10 19:17:19 -0600
committerGitHub <noreply@github.com>2024-02-11 02:17:19 +0100
commit84d6e8d121a1b329d26cc0e462aadd1108d99a04 (patch)
treef50072df2ffa3f86697aa7859185f71e1df7412e /src/Ryujinx.Headless.SDL2/Program.cs
parent95c4912d58a535de4f5c03a2e380bdd39a543c12 (diff)
Standardize logging locations across desktop platforms (#6238)1.1.1186
* Standardize logging locations across desktop platforms * Return null instead of empty literal on exceptions * Remove LogDirectoryPath from LoggerModule * Catch exception when creating DirectoryInfo in FileLogTarget * Remove redundant log path vars, handle exception better, add null check * Address styling issues * Remove extra newline, quote file path in log, move directory check to OpenHelper * Add GetOrCreateLogsDir to get/create log directory during runtime * misc format changes * Update src/Ryujinx.Common/Configuration/AppDataManager.cs --------- Co-authored-by: jcm <butt@butts.com> Co-authored-by: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Co-authored-by: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'src/Ryujinx.Headless.SDL2/Program.cs')
-rw-r--r--src/Ryujinx.Headless.SDL2/Program.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Ryujinx.Headless.SDL2/Program.cs b/src/Ryujinx.Headless.SDL2/Program.cs
index c2300275..85aff671 100644
--- a/src/Ryujinx.Headless.SDL2/Program.cs
+++ b/src/Ryujinx.Headless.SDL2/Program.cs
@@ -427,16 +427,12 @@ namespace Ryujinx.Headless.SDL2
if (!option.DisableFileLog)
{
- FileStream logFile = FileLogTarget.PrepareLogFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs"));
+ string logDir = AppDataManager.LogsDirPath;
+ FileStream logFile = null;
- if (logFile == null)
+ if (!string.IsNullOrEmpty(logDir))
{
- logFile = FileLogTarget.PrepareLogFile(Path.Combine(AppDataManager.BaseDirPath, "Logs"));
-
- if (logFile == null)
- {
- Logger.Error?.Print(LogClass.Application, "No writable log directory available. Make sure either the application directory or the Ryujinx directory is writable.");
- }
+ logFile = FileLogTarget.PrepareLogFile(logDir);
}
if (logFile != null)
@@ -447,6 +443,10 @@ namespace Ryujinx.Headless.SDL2
AsyncLogTargetOverflowAction.Block
));
}
+ else
+ {
+ Logger.Error?.Print(LogClass.Application, "No writable log directory available. Make sure either the Logs directory, Application Data, or the Ryujinx directory is writable.");
+ }
}
// Setup graphics configuration