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.
Adding two new API calls to set a logging callback and the log level (AKA verbosity).
The logging callback will be set for all projectM instances within an application, so it can also log initialization errors which were previously impossible to get or log from the outside.
Callback and log level can be set globally (for all threads) or just a specific thread. In case both a thread-specific and global callback or log level has been set, the thread-specific one takes precedence.
Log levels
TRACEandDEBUGonly have an effect inDebugbuilds. If the developer sets the new CMake argumentENABLE_VERBOSE_LOGGINGto a true value, anyReleasebuilds will also produce output on those log levels, at the potential cost of some performance.All existing output and error messages produced in libprojectM have been converted to use the Logging API, including the error messages produced by HLSLParser, which were previously only written to STDOUT.
I've also moved the GLSL version check from the static shader class to the top of the
class ProjectMconstructor. This will now check the available GLSL first and produce aFATALerror in the logging output if the version is missing or too low. Since the GLSL language is most indicative of a "good" GL context being available, no further checks are currently being performed (e.g. checking the actual GL version itself).Please comment if you're missing something with the logging API itself.
With the API now in place, additional log output will be added piece by piece as needed.
Closes #732