-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Support logging in geyser plugins #34101
Support logging in geyser plugins #34101
Conversation
setup logger in plugin
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #34101 +/- ##
=======================================
Coverage 81.9% 81.9%
=======================================
Files 812 812
Lines 219645 219660 +15
=======================================
+ Hits 179922 179982 +60
+ Misses 39723 39678 -45 |
does this really need to be so explicit? couldn't we dlopen the validator bin, dlsym the logger static, then dlclose the bin handle when unloading the plugin? i'm assuming that dangling implicit handle to the binary is what holds the plugin open on unload |
Co-authored-by: Tyera <[email protected]>
We could, but I dislike that even more -- it forces the plugin to know the internal about the validator's implementations. |
@t-nelson any more concerns? |
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.
seems ok for a first pass.
i'm sure operators will expect the admin console's solana-validator set-log-level
command to update the plugin(s) too. can be done in a followup
Good point. Will raise a new issue for it |
Problem
The plugins need to be able to log as the rest of the validator in the validator logs. The plugin could use solana_logger::setup_with_defaul, unfortunately it is found doing that will cause the plugin not be unloaded from memory when the Library was dropped.
Summary of Changes
The change creates a new interface in the GeyserPlugin interface to allow the runtime to pass the logging configuration to the plugin.
fn setup_logger(&self, logger: &'static dyn log::Log, level: log::LevelFilter) -> Result<()>;
Which the plugin can choose to set it up:
Fixes #