summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-06-29 12:52:00 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-06-29 12:52:13 (GMT)
commitb1d814153439e25d793ea729820398f0992c5d81 (patch)
tree817ab63d301d158bd14b3067f21ecdff2b36a0b8 /Help
parentc42a9dfce0b41b791d25f38a71afdbee28dba048 (diff)
parent23bbac941a94391548b57303f9ab371fa5a82b96 (diff)
downloadCMake-b1d814153439e25d793ea729820398f0992c5d81.zip
CMake-b1d814153439e25d793ea729820398f0992c5d81.tar.gz
CMake-b1d814153439e25d793ea729820398f0992c5d81.tar.bz2
Merge topic 'log_level_command'
23bbac941a Add cmake_language(GET_MESSAGE_LOG_LEVEL) sub command 2b6ef864e0 Move LogLevel enum out of cmake.h header Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7348
Diffstat (limited to 'Help')
-rw-r--r--Help/command/cmake_language.rst26
-rw-r--r--Help/manual/cmake.1.rst5
-rw-r--r--Help/release/dev/cmake_language_GET_MESSAGE_LOG_LEVEL.rst6
-rw-r--r--Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst5
4 files changed, 42 insertions, 0 deletions
diff --git a/Help/command/cmake_language.rst b/Help/command/cmake_language.rst
index cb8d60b..377e42d 100644
--- a/Help/command/cmake_language.rst
+++ b/Help/command/cmake_language.rst
@@ -14,6 +14,7 @@ Synopsis
cmake_language(`EVAL`_ CODE <code>...)
cmake_language(`DEFER`_ <options>... CALL <command> [<arg>...])
cmake_language(`SET_DEPENDENCY_PROVIDER`_ <command> SUPPORTED_METHODS <methods>...)
+ cmake_language(`GET_MESSAGE_LOG_LEVEL`_ <out-var>)
Introduction
^^^^^^^^^^^^
@@ -491,3 +492,28 @@ calling the provider command recursively for the same dependency.
SET_DEPENDENCY_PROVIDER mycomp_provide_dependency
SUPPORTED_METHODS FIND_PACKAGE
)
+
+Getting current message log level
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.25
+
+.. _GET_MESSAGE_LOG_LEVEL:
+.. _query_message_log_level:
+
+.. code-block:: cmake
+
+ cmake_language(GET_MESSAGE_LOG_LEVEL <output_variable>)
+
+Writes the current :command:`message` logging level
+into the given ``<output_variable>``.
+
+See :command:`message` for the possible logging levels.
+
+The current message logging level can be set either using the ``--log-level``
+command line option of the :manual:`cmake(1)` program or using
+the :variable:`CMAKE_MESSAGE_LOG_LEVEL` variable.
+
+If both the command line option and the variable are set, the command line
+option takes precedence. If neither are set, the default logging level
+is returned.
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 38105dd..2726f13 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -249,6 +249,11 @@ Options
For backward compatibility reasons, ``--loglevel`` is also accepted as a
synonym for this option.
+ .. versionadded:: 3.25
+ See the :command:`cmake_language`
+ :ref:`cmake_language <query_message_log_level>` command for a way to query
+ the current message logging level.
+
``--log-context``
Enable the :command:`message` command outputting context attached to each
message.
diff --git a/Help/release/dev/cmake_language_GET_MESSAGE_LOG_LEVEL.rst b/Help/release/dev/cmake_language_GET_MESSAGE_LOG_LEVEL.rst
new file mode 100644
index 0000000..6e99a05
--- /dev/null
+++ b/Help/release/dev/cmake_language_GET_MESSAGE_LOG_LEVEL.rst
@@ -0,0 +1,6 @@
+cmake-language_GET_MESSAGE_LOG_LEVEL
+------------------------------------
+
+* The :command:`cmake_language` command gained a new
+ ``GET_MESSAGE_LOG_LEVEL`` sub-command. It can be used to
+ query the current message logging level.
diff --git a/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst
index 3b45d1d..54ea6a4 100644
--- a/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst
+++ b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst
@@ -15,3 +15,8 @@ subsequent CMake runs will continue to use the chosen log level.
Projects should not set this variable, it is intended for users so that
they may control the log level according to their own needs.
+
+.. versionadded:: 3.25
+ See the :command:`cmake_language`
+ :ref:`cmake_language <query_message_log_level>` command for a way to query
+ the current message logging level.