rust-cli / human-panic

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

Make report mod public #56

Closed passy closed 5 years ago

passy commented 5 years ago

Choose one: 🙋 feature

Checklist

Context

Hi! 👋 I was wondering if you'd be opposed to the idea of exposing the report mod as public. It is pretty useful on its own and I intend to use the Report struct directly instead of printing the result.

No worries if you don't want to increase the API surface, though. :)

Semver Changes

It changes the public interface, but in a backwards-compatible way. So minor bump should be fine.

spacekookie commented 5 years ago

Hey there! Sorry it took so long to get to this.

So generally I'm not opposed to this. Especially because making human-panic more pluggable has been on my agenda for a while. There was a PR a while ago that kinda added window handling for panics which was a pretty neat idea but came with some other drawbacks. But this spawned the idea of having a general interface for letting programs deal with reports in some way (whether that just write to disk or be an automatic crash reporter or whatever).

Making this mod pub would go a good way towards allowing this. But I'm wondering if there's a nicer way to achieve that goal and if you'd be interested in collaborating to this effort.

Anyway, if we end up just making this module public there needs to be documentation for the newly exposed functions. I defer further opinions on this matter to @killercup and @yoshuawuyts :wave:

yoshuawuyts commented 5 years ago

I have no strong opinions here; happy to defer to your judgement @spacekookie!

passy commented 5 years ago

Hi! Now I have to apoligise for the long delay. I really like the approach of trying to find a more generic solution to the problem of working with reports. I'd definitely be happy to help out with this, whether it's by adding the missing docs or a different approach if you have something in mind. :)

passy commented 5 years ago

@spacekookie Amazing! I added some docstrings. Can you let me know if this looks good to you? I'm happy to expand or change things.