Skip to content
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

logging: support alternative print formatting function pointers #68982

Open
cfriedt opened this issue Feb 14, 2024 · 1 comment
Open

logging: support alternative print formatting function pointers #68982

cfriedt opened this issue Feb 14, 2024 · 1 comment
Assignees
Labels
area: Logging Feature Request A request for a new feature

Comments

@cfriedt
Copy link
Member

cfriedt commented Feb 14, 2024

Is your feature request related to a problem? Please describe.
For some use cases, it is helpful to support alternative string formatting function calls. For example, when dealing with logging in other programming languages (e.g. Rust).

Describe the solution you'd like
Support an additional field in e.g. struct log_source_const_data (or perhaps somewhere else that is more appropriate) that allows users to specify a function pointer to a custom string-formatting function.

For traditional logging, this could just be left as NULL for the default behaviour (or populated, if that is preferred).

If the function pointer is non-NULL, the log core would use the provided print formatter instead of the default.

Use of this feature could be gated via Kconfig.

It would be great if this could be declared via LOG_MODULE_REGISTER().

Describe alternatives you've considered

Additional context

Related RFC #65837

@nonas-hunter
Copy link

nonas-hunter commented Jul 23, 2024

Want to bump this feature request -- it would be very helpful for a project I am working on that takes the logs from zephyr and processes them using an existing program that prefers a specific log format that differs from zephyr's format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Logging Feature Request A request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants