-
Notifications
You must be signed in to change notification settings - Fork 33
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
common: improve logger #257
Conversation
4db0b2b
to
a576c43
Compare
I moved insertion/extraction operators from the operators module to the common module, because those operations need to be defined before the logger. If the operators are defined after the logger, they will not be found by the compiler when selecting the right specialization to be used for the insertion operator in Logger::println (gcc will still accept the code, but this is a gcc bug, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51577). |
a576c43
to
0ca3147
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, new logger interface is fine for me, there are some minor fixes to do, I'm just listing them here:
- .kdev4 folder, code.kdev4 file and cloc perl script, i think they are accidentally here
- example: pod_application_example_00002 does not compile and it's still using deprecated logger methods
- (just a warning for future rebasing) when this branch is rebased on the actual master, newest test_LA_parallel_00002 will trigger the deprecated stuff too.
0ca3147
to
cb18445
Compare
All fixed, thanks. I've also rebased the branch on top of the current master. |
Could it be useful for users to rely on an "enable" method for the logger? I understand the semantic, but double negation to enable (or re-enable) the logger (at its level( it seems not intuitive to me. Maybe a kind of "enableDefault", even if I do not like "Default". |
Hello guys, modifications are fine for me, but honestly I've not completely understood the request from Marco, and i don't want to rush my final approval. I will let you to iterate and elaborate more the concept, first. |
The function Its main purpose is to temporary throttle logging output down. When the logger verbosity can be set again to its defualt value, the function (I've updated the wording of the example in the pull request description to better reflect what the function |
Fine. Doc in sources was clear and your final comment too. Thanks for re-wording. I approve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for me too
The improvements are:
log::cout
now accepts an argument that specifies the default severity level of the messages;void Logger::disable(log::Level level = log::CRITICAL)
);setVerbosity
renamed tosetDefaultVerbosity
,setPriority
renamed tosetDefaultSevierity
), old functions are still there but they are marked as deprecated.Here some examples: