Skip to content

Conversation

elbeno
Copy link
Contributor

@elbeno elbeno commented Aug 18, 2025

Problem:

  • The writer has to be supplied in the log config; there are use cases for changing the writer in the environment. For instance this would provide an alternative, more flexible way to do secure logging.
  • The hardcoded dichotomy between log_by_args and log_by_buf is annoying and a relic of the original implementation.

Solution:

  • Allow the log writer to be passed in the log environment.
  • Instead of log_by_args and log_by_buf, a writer should provide a function that takes the span to write. Now the callee can choose whether to make that a function template and potentially unroll the write loop, or just a function taking a dynamic span with a runtime loop.

@elbeno elbeno force-pushed the log-env-writer branch 2 times, most recently from b3c5b08 to b0c0c65 Compare August 18, 2025 20:49
Copy link
Contributor

@mjcaisse-intel mjcaisse-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Great refactor.

Problem:
- The writer has to be supplied in the log config; there are use cases for
  changing the writer in the environment. For instance this would provide an
  alternative, more flexible way to do secure logging.
- The hardcoded dichotomy between `log_by_args` and `log_by_buf` is annoying and
  a relic of the original implementation.

Solution:
- Allow the log writer to be passed in the log environment.
- Instead of `log_by_args` and `log_by_buf`, a writer should provide a function
  that takes the span to write. Now the callee can choose whether to make that a
  function template and potentially unroll the write loop, or just a function
  taking a dynamic span with a runtime loop.
@elbeno elbeno enabled auto-merge August 19, 2025 21:45
@elbeno elbeno merged commit 2eb221b into intel:main Aug 19, 2025
27 checks passed
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.

2 participants