-
Notifications
You must be signed in to change notification settings - Fork 10
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
Allow more user control over logging #110
Comments
Having worked on this for a bit now, I'm in a better position to say what I'd like to achieve and how to get there, so let me try to rephrase the issue. The primary motivation is that cse-core users should be allowed to have full control over their programs' output. We should not just assume that users are happy to have messages written to the console in whichever format we decide. Furthermore, client code may already be using Boost.Log, and since the core of that library is a global singleton, we shouldn't just apply our own settings to it without the users asking for it. Here is what I want to do:
An immediate use case for all this is CSE CLI, which will have command-line switches to control logging. |
This changes the logging API so that it allows client code to have more control over logging, and to enable better integration with client code that also uses Boost.Log. Summary of changes: - `cse::log::level` renamed to `severity_level` and turned into a pseudo-alias for `boost::log::trivial::severity_level`. - Modification of global settings is now done by separate functions that users must call explicitly. These are in a new header, `cse/log/simple.hpp`. - Similar changes in the C library. - Added setup function calls to all tests, with an output level of "info" if no other level was previously requested. This closes #110.
This changes the logging API so that it allows client code to have more control over logging, and to enable better integration with client code that also uses Boost.Log. Summary of changes: - `cse::log::level` renamed to `severity_level` and turned into a pseudo-alias for `boost::log::trivial::severity_level`. - Modification of global settings is now done by separate functions that users must call explicitly. These are in a new header, `cse/log/simple.hpp`. - Similar changes in the C library. - Added setup function calls to all tests, with an output level of "info" if no other level was previously requested. This closes #110.
To give client code greater control over logging, a few more items should be added to the public API in
cse/log.hpp
:cse/log/logger.hpp
, but may have to be modified a bit)The text was updated successfully, but these errors were encountered: