This basically is the unwired version of what I did so far. #1
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.
Hi Klaim
libs/network/test/logger_demo.cpp shows a demo of different usage modes of the code
under include/network/utils/
The idea would be that any class that wants to log derives from log_base, and that there are basicly 3 ways such a derived class might have its log stream initialized:
There is also an inner loop log macro. The idea is that a stream is more convenient than a macro, but
a macro is the only way to truly turn logging off. Normally the overhead of logging to a null-stream is negligible, but in an inner loop it often is not and, and you will want to sacrifice the convenience of logging to a stream for non-debug performance reasons.
I hope my code makes sense, and if so, please let me know if you find it is usefull to integrate it or parts of it with your work.