Skip to content

Commit

Permalink
Merge pull request #79 from aschuhardt/beta
Browse files Browse the repository at this point in the history
Error log exporting fix
  • Loading branch information
aschuhardt authored Dec 27, 2023
2 parents 7e78f15 + d8d3755 commit 94d3866
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Resources/Raw/whats-new.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
margin-top: 0!important;
}
</style>
<h4>Version 1.4.6 - December 26th, 2023</h4>
<p><a class="tracker-id" href="gemini://bbs.geminispace.org/s/Rosy-Crow-Issues/38">#38</a> Error logs will now be correctly exported when that feature is used, rather than an empty file.</p>
<h4>Version 1.4.5 - December 3rd, 2023</h4>
<p>Fixed an issue that prevented tabs loaded on startup from showing prompts</p>
<h4>Version 1.4.4 - November 27th, 2023</h4>
Expand Down
13 changes: 7 additions & 6 deletions Views/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,17 @@ await DisplayAlert(Text.SettingsPage_ExportErrorLogArchive_Lacking_Permission,
}

FileSaverResult result;

await using (var buffer = new MemoryStream())
{
await using var gzip = new GZipStream(buffer, CompressionLevel.Optimal);
await TarFile.CreateFromDirectoryAsync(logsDir, gzip, false);
using (var archive = new ZipArchive(buffer, ZipArchiveMode.Create, true))
{
foreach (var logPath in Directory.GetFiles(logsDir))
archive.CreateEntryFromFile(logPath, Path.GetFileName(logPath));
}

buffer.Seek(0, SeekOrigin.Begin);
result = await FileSaver.Default.SaveAsync($@"rosycrow_logs_{DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}.tar.gz",
buffer,
CancellationToken.None);
result = await FileSaver.Default.SaveAsync($@"rosycrow_logs_{DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}.zip",
buffer, CancellationToken.None);
}

if (result.IsSuccessful)
Expand Down

0 comments on commit 94d3866

Please sign in to comment.