Commit graph

20 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 6fb197cf0b Refactor 2025-04-02 00:34:52 +03:00
Leonardo Mosquera 7add81a472
Don't consider it an error if there is nothing to export (#1349) 2025-04-02 00:14:35 +03:00
Tyrrrz 619fe9ccf7 Refactor using c# 12 features 2023-12-10 22:38:34 +02:00
Tyrrrz 5397b0db7d Fix formatting 2023-11-16 21:12:41 +02:00
Tyrrrz e89701e3f9 Provide more context in exception messages 2023-11-16 21:10:24 +02:00
Tyrrrz 20f58963a6 Use CSharpier 2023-08-22 21:17:19 +03:00
Tyrrrz ddfbe51cfa Improve error reporting on unexpected HTTP status code 2023-07-25 18:59:05 +03:00
Tyrrrz a29c517527 Update exception wording again 2023-02-16 22:13:50 +02:00
Tyrrrz 83657962b8 Improve "channel is empty" error message 2023-02-16 20:54:28 +02:00
Tyrrrz 2259f19c44 Remove message content intent check due to false positives 2022-10-08 15:35:06 +03:00
Tyrrrz 06a4b6a8e6 Add checks for message content intent on bot accounts
Related to #918
2022-09-16 23:04:18 +03:00
Tyrrrz 880f400e2c C#10ify 2021-12-08 23:50:21 +02:00
Tyrrrz ea31b1b270 Refactor 2021-09-16 01:08:14 +03:00
Tyrrrz 35264e8a12 Improve "Requested resource does not exist" exception message to give slightly more context 2021-07-18 00:15:06 +03:00
Tyrrrz 58464d8708 Improve error messages 2021-03-24 22:39:01 +02:00
Tyrrrz ebe4d58a42 Cleanup 2021-02-22 03:15:22 +02:00
Alexey Golub 4bfb2ec7fd
Improve performance (#162) 2019-04-10 23:45:21 +03:00
Alexey Golub 49f39c7097 Add retry policy for 429 responses 2018-06-28 00:20:31 +03:00
Alexey Golub 8515efe11b
Add command line interface and change solution structure (#26) 2018-01-12 20:28:36 +01:00