Skip to content

Enable setting of global context (solves #227) - #228

Open
Davoodeh wants to merge 1 commit into
a1ien:masterfrom
Davoodeh:master
Open

Enable setting of global context (solves #227)#228
Davoodeh wants to merge 1 commit into
a1ien:masterfrom
Davoodeh:master

Conversation

@Davoodeh

@Davoodeh Davoodeh commented Aug 10, 2026

Copy link
Copy Markdown

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:

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...

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)
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.

1 participant