Enable setting of global context (solves #227) - #228
Open
Davoodeh wants to merge 1 commit into
Open
Conversation
With the current implementation, there are no save and coherent way to register a global logger with the same mechanims of `static_log_callback`. This introduces a symmetical function as with the global `set_log_level` named `set_global_log_callback` that enables a registration of an entry in `LOG_CALLBACK_MAP` with a pointer of 0x0. Possibly this removes the need for a dedicated and public `LogCallback` struct. See also: - https://libusb.sourceforge.io/api-1.0/group__libusb__lib.html#ga2efb66b8f16ffb0851f3907794c06e20 - a1ien#227 (comment) - dfu-rs/cargo-dfu#12 (comment)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
With the current implementation, there are no save and coherent way to register a global logger with the same mechanims of
static_log_callback. This introduces a symmetical function as with the globalset_log_levelnamedset_global_log_callbackthat enables a registration of an entry inLOG_CALLBACK_MAPwith a pointer of 0x0.Possibly this removes the need for a dedicated and public
LogCallbackstruct.See also:
set_log_callbacklike the globalset_log_level#227 (comment)This got messy super fast. It was certainly not my intention. Wish I made a good old fast and clean PR instead of the related issue and all the talk and fuss. Sorry about that...