libs/network/test/logger_demo.cpp shows a demo of different usage modes of the code
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.
Now NETWORK_MESSAGE() use logging library impl.
Added a custom log handler in client "get" test.
Fixed: when logging is disabled, no logging code.
Indentation is incorrect.
What exactly is this testing?
It would be better not to adapt an existing test, but to create a new one that you can use to test that the handler is being called correctly.
It was only to check that adding a custom logger would work.
You're right, I will make a proper test soon.
I'm not sure how to remove the two commits related to the test...
Added the (unwired) parts of logging attempts with a small demo to sh…
…ow how stuff could work.
Merge branch 'master' of https://github.com/Klaim/cpp-netlib
Merge branch 'master' of github.com:pibara/cpp-netlib
Merge branch 'master' of https://github.com/cpp-netlib/cpp-netlib
Added CharUtil proposal
Added proposal for CharUtil usage.