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

Transform feature "ignore-logger-errors" to additive feature. #476

Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
- Deprecated `BootServices::locate_protocol` and marked it `unsafe`. Use
`BootServices::get_handle_for_protocol` and
`BootServices::open_protocol` instead.
- renamed feature `ignore-logger-errors` to `panic-on-logger-errors` so that it is
additive. It is now a default feature.

### Removed

Expand All @@ -39,7 +41,7 @@

- The `no_panic_handler` feature has been replaced with an additive
`panic_handler` feature. The new feature is enabled by default.

## uefi - 0.16.1

### Added
Expand All @@ -55,7 +57,7 @@
function pointers. This prevents potential invalid pointer access.
- Fixed an incorrect pointer cast in the `Rng` protocol that could cause
undefined behavior.

### Changed

- Relaxed the version requirements for the `bitflags` and `log`
Expand Down
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ categories = ["embedded", "no-std", "api-bindings"]
license = "MPL-2.0"

[features]
default = []
default = ["panic-on-logger-errors"]
alloc = []
exts = []
logger = []
# Ignore text output errors in logger as a workaround for firmware issues that
# were observed on the VirtualBox UEFI implementation (see uefi-rs#121)
ignore-logger-errors = []
# were observed on the VirtualBox UEFI implementation (see uefi-rs#121).
# In those cases, this feature can be excluded by removing the default features.
panic-on-logger-errors = []

[dependencies]
bitflags = "1.3.1"
Expand Down
6 changes: 3 additions & 3 deletions src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ impl log::Log for Logger {
// Ignoring errors is bad, especially when they represent loss of
// precious early-boot system diagnosis data, so we panic by
// default. But if you experience this problem and want your UEFI
// application to keep running when it happens, you can enable the
// `ignore-logger-error` cargo feature. If you do so, logging errors
// application to keep running when it happens, you can disable the
// `panic-on-logger-errors` cargo feature. If you do so, logging errors
// will be ignored by `uefi-rs` instead.
//
if !cfg!(feature = "ignore-logger-errors") {
if cfg!(feature = "panic-on-logger-errors") {
result.unwrap()
}
}
Expand Down