forked from Astrabit-ST/Luminol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use color-eyre for error handling and add a log window (Astrabit-ST#83)
* fix: properly set log verbosity to full in web builds To set the verbosity in web builds, we need to use `.lib_verbosity`, not `.verbosity`. There will still be no backtrace displayed because we are using the `panic_abort` panic handler instead of the normal `panic_unwind` handler that native builds use. There is currently no support for `panic_unwind` on the `wasm32-unknown-unknown` target unless we use `no_std`. * feat: show error context in error toasts * refactor: use `anyhow::Result` instead of custom result types * fix: fix web compilation errors * chore: remove redundant `.into()`s * feat: add more descriptive messages for filesystem errors * feat: add context to archiver and host filesystems * fix: properly propagate context for `std::io::Error` * refactor: migrate from anyhow to color-eyre Moving to color-eyre allows us to use color-backtrace for formatting errors, which anyhow does not support. It's otherwise essentially the same as anyhow but with some peculiar and confusing names in the API changed. * feat: log color-eyre errors and panics to console * chore: `color_eyre::eyre::Result` -> `color_eyre::Result` * chore: remove `time` tokio feature and add `parking_lot` feature * feat: add an output window in native builds for showing the log * chore: remove tracing from root dependencies * fix: output is now preserved after closing the output window * chore: remove unused `output_term_rx` fields * fix: make the output terminal larger * fix: terminal UI improvements The terminal now immediately resizes to the correct size instead of starting at the wrong size and taking several frames to resize. The terminal size controls have been moved to the top of the terminal window so that if the terminal is too big to fit on the screen, the user can still access the controls to make it smaller. Also, the format is now COLS x ROWS instead of ROWS x COLS. The terminal also handles focus and hover correctly now. It won't change the cursor unless the terminal is hovered, and it won't accept keyboard input unless it's focused. Also, the terminal no longer requests a rerender every frame. Now, it only does that if the terminal's contents have been updated. For the output window, this is done by making the tracing writer call `ctx.request_repaint()` every time it writes to the log. For shells, this is done by doing the same whenever there is at least one terminal action received by the thread. * feat: filter out useless backtrace frames * chore: remove luminol-term from luminol-core dependencies * fix: hide error when project loading is cancelled * fix: filter out more backtrace frames * fix: backtrace filters now filter out egui_dock * refactor: toast functions are now macros This is so that the logs accurately display where the toast was created from instead of displaying the location as somewhere in toasts.rs. * fix: filter out `T as core::` in backtrace filters * fix: increase the default toast duration to 7 seconds * chore: clippy * chore: remove unused dependencies * feat: add "Clear" and "Save to file" to output window * refactor: rename the output window to log window * fix: more terminal UI fixes * fix: add more backtrace filters * feat: add more error context to the filesystems * feat: display git version in errors and panics * fix: replace some `eprintln!` logging with proper errors * refactor: split archiver/filesystem.rs into smaller files * fix: reset terminal spacing on error * fix: unload project when project fails to load * fix: log buffer now has a bounded size * fix: don't unmark data cache as modified until saving completes * style: replace `.wrap_err(format!` with `.wrap_err_with(|| format!` * style: add `#[doc(hidden)]` to `_e_add_version_section`
- Loading branch information
Showing
49 changed files
with
3,310 additions
and
1,509 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.