Commit graph

17 commits

Author SHA1 Message Date
Kornelius Rohrschneider 4461a53f8b
Added an export progress logger
An export progress logger has been added to the exporter. It provides a consistent way to log the entire process of an export, meaning all status updates of each of the exported channels. It also allows to count the different results of the individual channel exports and can provide a summary of them.
There are two subclasses: The ConsoleProgressLogger logs the status updates with colors on the console while the SnackbarProgressLogger logs them in the GUI snackbar.

Previously, two exceptions had been used to signalize "warnings" and "errors", and respective messages had been displayed (GUI) respectively collected and displayed after the export finished (CLI) upon catching them.
Individual counts had been used to display an export summary message after the export finished.

The new logging system has numerous advantages:
- It allows logging status updates during a channel export (without having to abort it). Therefore, it also allows for informational messages, success messages and (non-urgent) warning messages to be logged.
- It doesn't use exceptions in situations without any need for exceptional handling, resulting in cleaner code.
- It logs all these messages instantly on both the CLI and GUI, instead of only displaying the log messages after the export finished.
- It removes duplicated code structures between the CLI and GUI parts; replacing individual logging / counting code with a general consistent logger / counter, which improves the code quality.
- This also makes it handle the logging much more consistently: Not only are the messages logged in the general export codebase, but their appearance and formatting are now defined together in a single place, making the logging system much more consistent and maintainable.

Using the new system, many informational messages and warning messages have been added to the export process. This particularly includes messages about the handling of existing export files that had been added provisionally with Console.WriteLine.
The existing messages have also been made more consistent with each other.
Furthermore, the logging of success messages has been added to the exporter. This allows the user to better watch the progress in the GUI and solves the problem that the progress hadn't been watchable in the CLI if parallel exports had been enabled.

The export summary message has also been massively improved:
While previously, it had just contained the number of channels that have been successfully exported, the handling of existing export files has added other possible export results, specifically the channel having already been exported and being appended or overwritten successfully, and the channel having already been exported and not having been appended as there are no new messages.
Therefore, the export summary has been changed to contain the number of channel exports that resulted in each occurring export result.
This also means that it now contains the number of empty new channel exports (which had previously not been included).
2025-10-28 02:34:21 +01:00
Tyrrrz 09e0b3f133 Format stuff 2024-10-26 21:41:16 +03:00
Tyrrrz b298b45cf7 Escape markup in CLI 2023-10-13 01:17:13 +03:00
Tyrrrz 09f8937d99 Refactor 2023-10-09 16:18:56 +03:00
Tyrrrz 1b2bcf771d Add fallback for progress tasks without name in CLI
Closes #1133
2023-09-26 00:13:22 +03:00
Tyrrrz 20f58963a6 Use CSharpier 2023-08-22 21:17:19 +03:00
Oleksii Holub f505ff3f1e Handle failed progress tasks as completed in CLI
Closes #988
2023-01-18 19:39:39 +02:00
Tyrrrz 880f400e2c C#10ify 2021-12-08 23:50:21 +02:00
Tyrrrz 2f3e165988 Update NuGet packages 2021-10-07 15:54:01 +03:00
Tyrrrz 67313f2b22 Clean up tests 2021-09-08 01:18:35 +03:00
Tyrrrz cad6baba48 Fix coverage collection in tests 2021-07-19 22:28:30 +03:00
Tyrrrz 28de1053f6 Workaround for Spectre parallelization issue in tests 2021-07-19 20:59:48 +03:00
Tyrrrz 021682899a [CLI] Move Markup.Escape(...) to ConsoleExtensions 2021-04-26 19:47:25 +03:00
Tyrrrz e7c2564f6f Update NuGet packages 2021-04-24 21:08:57 +03:00
Tyrrrz 1b8af364d3 [CLI] Cleanup 2021-03-24 22:39:27 +02:00
Tyrrrz 390735032e [CLI] Hack Spectre.Console so that it properly supports CliFx encoding 2021-03-24 02:51:11 +02:00
Tyrrrz 017ed5ae6d [CLI] Update CliFx and use Spectre.Console for progress reporting 2021-03-23 22:38:44 +02:00