libcnb.rs icon indicating copy to clipboard operation
libcnb.rs copied to clipboard

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

Open edmorley opened this issue 1 year ago • 1 comments

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 avatar Nov 02 '23 11:11 edmorley

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

edmorley avatar Feb 14 '24 10:02 edmorley