Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making Logger unwind safe #111

Closed
jsgf opened this issue Feb 9, 2017 · 4 comments
Closed

Making Logger unwind safe #111

jsgf opened this issue Feb 9, 2017 · 4 comments
Milestone

Comments

@jsgf
Copy link

jsgf commented Feb 9, 2017

Right now trying to use a Logger within a std::panic::catch_unwind block fails to compile with

the trait `std::panic::RefUnwindSafe` is not implemented for `slog::ser::SyncMultiSerialize + 'static`

I can use AssertUnwindSafe, but I'm not sure if that's actually true.

Is there currently a way to use slog safely in this case, or if not, could there be?

@dpc
Copy link
Collaborator

dpc commented Feb 9, 2017

I need to do some homework on uniwind safety. IIRC, it's about adding a marker trait here and there if types are indeed unwind safe. I think all serializable key&values that slog supports should be.

Thank you for reporting it and please remind me in case I don't get back to you until the end of the weekend.

@dpc
Copy link
Collaborator

dpc commented Feb 12, 2017

So they way I understand it, I'll have to add UnwindSafe bound on some of the traits that users can implement for key-value pairs.

I'm in the middle of some other stuff, but let's keep it open.

@dpc dpc added this to the 2.0.0 milestone Feb 19, 2017
dpc added a commit that referenced this issue Feb 19, 2017
@dpc
Copy link
Collaborator

dpc commented Feb 19, 2017

This will be fixed in slog v2 (actually next alpha release of it). Please test at first opporunity (when all drains you need will be ported to slog v2).

@dpc
Copy link
Collaborator

dpc commented Feb 24, 2017

slog v2.0.0-alpha2 has been released. There are some compiler regressions (see #115) and it's generally PITA because all trait objects now require a UnwindSafe qualifier which sometimes needs to be done through a separate trait, but oh well...

Closing. Feel free to reopen in case of troubles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants