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

This basically is the unwired version of what I did so far. #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

This basically is the unwired version of what I did so far. #1

wants to merge 10 commits into from

Conversation

pibara
Copy link

@pibara pibara commented Nov 13, 2012

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:

  • as default null stream
  • as staticly (pre constructor time) injected static process wide logger stream.
  • as constructor injected log stream.

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.

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.

None yet

3 participants