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

Adds set_logging_function to ffi-bindings #305

Merged
merged 6 commits into from
Aug 16, 2022

Conversation

csabol
Copy link
Contributor

@csabol csabol commented Aug 16, 2022

set_logging_function sets the default subscriber for tracing to a provided function pointer that can forward logs to C executables.

boringtun/src/ffi/mod.rs Outdated Show resolved Hide resolved
boringtun/src/ffi/mod.rs Outdated Show resolved Hide resolved
boringtun/src/ffi/mod.rs Outdated Show resolved Hide resolved
boringtun/src/ffi/mod.rs Show resolved Hide resolved
boringtun/src/ffi/mod.rs Outdated Show resolved Hide resolved
boringtun/src/ffi/mod.rs Show resolved Hide resolved
boringtun/src/wireguard_ffi.h Outdated Show resolved Hide resolved
boringtun/src/wireguard_ffi.h Show resolved Hide resolved
boringtun/src/ffi/mod.rs Outdated Show resolved Hide resolved
boringtun/src/ffi/mod.rs Show resolved Hide resolved
@Noah-Kennedy
Copy link
Collaborator

Good work! I left some feedback, but its almost there!

* Removes usage of `unwrap`
* Adds # Safety and failure docstrings
* Wraps execution in `catch_unwind`
* Uses `try_init` instead of `finish` and `set_global_default`
@Noah-Kennedy Noah-Kennedy enabled auto-merge (squash) August 16, 2022 20:52
@Noah-Kennedy Noah-Kennedy merged commit 829dae2 into master Aug 16, 2022
@Noah-Kennedy Noah-Kennedy deleted the csabol/ffi_logging_function branch August 16, 2022 20:55
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

Successfully merging this pull request may close these issues.

2 participants