Skip to content

Commit

Permalink
Merge pull request #968 from dremin/log-fixes
Browse files Browse the repository at this point in the history
Misc logging fixes
  • Loading branch information
dremin authored Dec 1, 2024
2 parents 74228bd + ce8e09b commit d8d56a7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions RetroBar/Utilities/ManagedShellLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,24 @@ private void SetupLogging()

SetupFileLog();

ShellLogger.Attach(new ConsoleLog());
ShellLogger.Attach(new ConsoleLog(), true);
}

private void SetupFileLog()
{
DeleteOldLogFiles();

_fileLog = new FileLog(Path.Combine(_logPath, $"{_logName}.{_logExt}"));
_fileLog?.Open();
try
{
_fileLog = new FileLog(Path.Combine(_logPath, $"{_logName}.{_logExt}"));
_fileLog?.Open();

ShellLogger.Attach(_fileLog);
ShellLogger.Attach(_fileLog);
}
catch (Exception ex)
{
ShellLogger.Error($"Unable to open and attach file logger: {ex.Message}");
}
}

private void DeleteOldLogFiles()
Expand Down

0 comments on commit d8d56a7

Please sign in to comment.