You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 16, 2021. It is now read-only.
My application uses the general Rust log crate, as well as lots of error_chain. I'd like to contribute a feature for this crate called log, which causes quick_main! to write its output to error! instead of (or in addition to) stderr when the feature is enabled.
Additionally, I think it could be useful to have calls to chain_err write their information at the debug level; however, this could be overly verbose. At the same time, chain_err closures contain a lot of useful information that could reduce the burden to write useful logging statements, but still be able to debug an application more easily.
Would you be willing to accept this contribution?
The text was updated successfully, but these errors were encountered:
The entire bit of functionality is a crate feature, so it must be explicitly enabled (if not enabled, it changes nothing).
quick_main! uses error! instead of println! when the feature's enabled
chain_err prints the return value of its closure using debug!("{:?}", err) if it ends up actually chaining an error, and if the return value of the closure implements Debug (I think this is doable via Any for a runtime check whether it supports Debug).
Logging potentially caught errors to debug should mostly be useful for situations in which errors are being used, but logging hasn't been written. As a result, I think using any level more urgent than debug or trace isn't desirable, as this feature would make it easier to get a bit more debugging context without recompiling; it wouldn't replace proper logging.
Hello, I've created a pull request finally to solve this. I gave up for a while without realizing that #[cfg()] attributes are silently ignored or have different behavior on expressions within macros than on top level functions.
My application uses the general Rust
log
crate, as well as lots oferror_chain
. I'd like to contribute a feature for this crate calledlog
, which causesquick_main!
to write its output toerror!
instead of (or in addition to)stderr
when the feature is enabled.Additionally, I think it could be useful to have calls to
chain_err
write their information at thedebug
level; however, this could be overly verbose. At the same time,chain_err
closures contain a lot of useful information that could reduce the burden to write useful logging statements, but still be able to debug an application more easily.Would you be willing to accept this contribution?
The text was updated successfully, but these errors were encountered: