-
Notifications
You must be signed in to change notification settings - Fork 126
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
plugins: Allow plugins to customize their log colors #823
Conversation
Were the plugin field and plugin string enums supposed to be non exhaustive? |
yes to allow adding more fields in the future they're supposed to be non exhaustive |
Alright a few plugins crashing is fine for now ig |
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 above review wasnt supposed to be an approval smh
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.
Current rrplug builds return uninitialized values for colors. If a plugin returns 0 as color, a default will be used |
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.
Confirmed working in testing together with R2Northstar/NorthstarDiscordRPC#26 :D
Co-authored-by: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>
cc @F1F7Y whether you wanna re-review, given that you requested changes. Otherwise if there's no response I'd merge within a day or two to not stall the PR o7 |
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.
Code looks acceptable
If the color flag is 0 (expected but undocumented default behaviour of plugins for GetField) NS::Colors::PLUGIN is used as a default.
The Color is packed into a 64 bit integer like this
The colors only occupy the lower 3 bytes of the integer. The remaining bits are ignored. When determining to use the default color or the provided log color, the lower 12 bits are checked if any is not 0.
Related: R2Northstar/NorthstarDiscordRPC#26