cmake_language: Add GET_MESSAGE_LOG_LEVEL subcommand
The new sub-command writes a string representation of the current log level to the output variable given to the sub-command.
Given that the log-level might be set either via the --log-level command line option or via the CMAKE_MESSAGE_LOG_LEVEL cache / regular variables, the priority for each of the log level sources is as follows, with the first one being the highest:
- --log-level
- CMAKE_MESSAGE_LOG_LEVEL regular variable
- CMAKE_MESSAGE_LOG_LEVEL cache variable
- default log level (STATUS)
Fixes: #23572 (closed)
Edited by Brad King