Skip to content

Conversation

@anarthal
Copy link
Collaborator

Replaces connection_logger by buffered_logger and log_utils.hpp
Adds a system to log arbitrary values without defining new logger methods

@anarthal anarthal requested a review from mzimbres October 21, 2025 09:50
@anarthal
Copy link
Collaborator Author

This is an intent to make logging more self-contained. The idea is moving all logging logic away from the big connection_logger class into the FSMs, which have the context of what should be logged and why.

I've renamed connection_logger to buffered_logger, which is just a logger + a std::string to reuse memory. All functions are now in a separate file log_utils.hpp which only gets included in .ipp files, with a hopefully positive effect on build times.

The idea is that calling log_debug(logger, args) will do the right thing, formatting all arguments and performing the level check automatically. I've used some lightweight template metaprogramming to do this.

After this, the idea is adjusting severities and messages accordingly to make logging more user friendly. Take these lines for instance. I think it would make sense that the success and error branches had different log levels. But this will come later.

Entails no functional change.

@anarthal
Copy link
Collaborator Author

Merging as per Marcelo's request.

@anarthal anarthal merged commit 033f6aa into boostorg:develop Oct 22, 2025
17 checks passed
@anarthal anarthal deleted the feature/better-logging branch October 22, 2025 10:00
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