-
Notifications
You must be signed in to change notification settings - Fork 27
Forward Rust logs through FFI to SDK logger #133
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
Open
alan-george-lk
wants to merge
19
commits into
main
Choose a base branch
from
feature/forward_rust_logs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b5450af
Forward FFI log events to LK log
alan-george-lk 55183f0
Get rust logs through actually
alan-george-lk 8b841ee
Cleaned up event callback for Ffi, added panic support, cleaner unit …
alan-george-lk 939829f
Logging test cleanup
alan-george-lk 747d5ad
Merge branch 'main' of github.com:livekit/client-sdk-cpp into feature…
alan-george-lk bfd09f4
Try latest FFI release
alan-george-lk 880df99
Cleanup how cv works
alan-george-lk d1f7d19
Cleaner info inducing
alan-george-lk 4082120
Cleanup tests file
alan-george-lk 1962627
Undo test file changes
alan-george-lk a7f99c2
Better testing of level mapping
alan-george-lk 2273f9a
Maybe fix crash
alan-george-lk 8114b47
Maybe fix race
alan-george-lk fe5ab0e
Better test setup, fix FFI compiler issue
alan-george-lk 545ed71
Deprecate LogSink initialize signature
alan-george-lk d3ce627
Only acquire the mutex once for FFI log forwarding
alan-george-lk e8a039f
Additional test to ensure logs aren't forwarded
alan-george-lk 21c250a
Try cleaning up global header inclusion
alan-george-lk 8210d0e
Undo header change
alan-george-lk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule client-sdk-rust
updated
from 8d4d06 to b7d8d1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,14 +22,17 @@ | |
| namespace livekit { | ||
|
|
||
| bool initialize(const LogLevel& level, const LogSink& log_sink) { | ||
| (void)log_sink; | ||
| return initialize(level); | ||
| } | ||
|
|
||
| bool initialize(const LogLevel& level) { | ||
| // Initializes logger if singleton instance is not already initialized | ||
| setLogLevel(level); | ||
| auto& ffi_client = FfiClient::instance(); | ||
| return ffi_client.initialize(log_sink == LogSink::kCallback); | ||
| return ffi_client.initialize(true); | ||
| } | ||
|
|
||
| bool isInitialized() { return FfiClient::instance().isInitialized(); } | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This accidentally made it in from an older PR (no header signature equivalent) |
||
|
|
||
| void shutdown() { | ||
| FfiClient::instance().shutdown(); | ||
| detail::shutdownLogger(); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
log_sinkvariable was not working as I suspect it was intended previously. The argument toFfiClient::initializehere was to enable FFI logging (forwards all Rust log macros over the FFI callback as events), butLogSink::kCallbackas a sink type is basically irrelevant to that feature. And passing that value here didn't actually register any callbacks. We should figure out what to do here, options are:livekit::initialize().initialize(true)as-isLogSinkcalledkOff, and then this arg becomes.initialize(log_sink != kOff), so users have the ability to turn off the FFI logs. But then that brings up the question, we probably should have a cleaner log control. Just turning off FFI logs while others remain doesn't really make sense