Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug analyst in not isolation version #165

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ static bool IsValidLogFile(FileInfo fi, double minutesAgo = 3)
var fullRootPath = Path.GetFullPath(RootPath);
var versionPath = Path.Combine(fullRootPath, GamePathHelper.GetGamePath(GameId));

var crashReportDi = new DirectoryInfo(Path.Combine(versionPath, "crash-reports"));
var crashReportDi = new DirectoryInfo(Path.Combine(VersionIsolation ? versionPath : RootPath, "crash-reports"));
if (crashReportDi.Exists)
logFiles.AddRange(crashReportDi.GetFiles().Where(fi => fi.Extension is ".log" or ".txt"));

var versionDi = new DirectoryInfo(VersionIsolation ? RootPath : versionPath);
if (versionDi.Exists)
logFiles.AddRange(versionDi.GetFiles().Where(fi => fi.Extension == ".log"));

logFiles.Add(new FileInfo(Path.Combine(versionPath, "logs", "latest.log")));
logFiles.Add(new FileInfo(Path.Combine(versionPath, "logs", "debug.log")));
logFiles.Add(new FileInfo(Path.Combine(VersionIsolation ? versionPath : RootPath, "logs", "latest.log")));
logFiles.Add(new FileInfo(Path.Combine(VersionIsolation ? versionPath : RootPath, "logs", "debug.log")));

if (CustomLogFiles is { Count: > 0 })
logFiles.AddRange(CustomLogFiles.Select(custom => new FileInfo(custom)));
Expand All @@ -134,7 +134,7 @@ static bool IsValidLogFile(FileInfo fi, double minutesAgo = 3)
var logType = GetLogFileType(log);

if (logType == LogFileType.Unknown) continue;

var content = File.ReadAllText(log.FullName, Encoding.GetEncoding("GB2312"));

if (string.IsNullOrWhiteSpace(content)) continue;
Expand Down Expand Up @@ -521,4 +521,4 @@ static IEnumerable<IAnalysisReport> AnalysisLogs2(IReadOnlyDictionary<LogFileTyp
}

#endregion
}
}