rust-cli / human-panic

Panic messages for humans.
https://docs.rs/human-panic
Apache License 2.0
1.66k stars 65 forks source link

Only display message for humans (implementing #48) #50

Closed spacekookie closed 6 years ago

spacekookie commented 6 years ago

This is a πŸ™‹ feature.

Overview

The general rationale for this is documented in #48. This PR implements the required behaviour. A human-panic message will only be displayed if two conditions are met

  1. The program is not running in DEBUG mode
  2. RUST_BACKTRACE is not set as an env variable

This PR also adjusts the tests to check for both present and non-present human-panic messages.


There are two things missing

Checklist

Semver change

Now, this is a matter of how you define a version breakage. SemVer is ambigous when it comes to what is and isn't a breakage, for example, if people are depending on human-panic messages to be present to parse things from logs then any tool that updates human-panic while we are changing behaviour will break.

In the code, this is at most a minor bump. But seeing as we're also looking at things to add for a 2.0 release, we might want to put it on the tracking issue (#46).

Either way, we need to document this change because it might have a large impact on people who depend on the stdout message to be present.