heroku / libcnb.rs

A framework for writing Cloud Native Buildpacks in Rust
BSD 3-Clause "New" or "Revised" License
34 stars 6 forks source link

`log_error()`, `log_warning()`, `log_info()` and `log_header()` should use `.expect()` instead of `.unwrap()` #712

Open edmorley opened 10 months ago

edmorley commented 10 months ago

Currently there are lots of usages of unwrap() in production code, in the logging helpers in: https://github.com/heroku/libcnb.rs/blob/2698a713edf19034e382aa702e12acc1516da8fa/libherokubuildpack/src/log.rs

Whilst the nature of these failure modes means that we can't use a Result (and so panicing is appropriate) - we should use .expect() instead of an .unwrap() so at least the panic message is more descriptive.

edmorley commented 7 months ago

Note: The log module will be removed in the future, since it's been superseded by the build_output module.