vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

[Bug] VERBOSE messages are not displayed in the console

Open josephgarnier opened this issue 4 months ago β€’ 3 comments

Brief Issue Summary

VERBOSE messages like message(VERBOSE "my message") are not displayed in the output console when the setting cmake.loggingLevel is set to "debug" or "trace" and I use the β€œConfigure” button in CMake Tools. Whereas they are displayed when I use the command cmake --log-level=TRACE -S "$(pwd)" --preset "x64-Release-Linux-GCC" in a terminal.

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.105.1",
  "cmtVersion": "1.21.36",
  "configurations": [
    {
      "folder": "c:\\Users\\xxxxx\\Cpp_starter_project_cmake",
      "cmakeVersion": "unknown",
      "configured": false,
      "generator": "unknown",
      "usesPresets": false,
      "compilers": {}
    },
    {
      "folder": "c:\\Users\\xxxxx\\Cpp_starter_project_cmake\\dev",
      "cmakeVersion": "4.0.1",
      "configured": true,
      "generator": "MinGW Makefiles",
      "usesPresets": true,
      "compilers": {}
    },
    {
      "folder": "c:\\Users\\xxxxx\\Cpp_starter_project_cmake\\test",
      "cmakeVersion": "unknown",
      "configured": false,
      "generator": "unknown",
      "usesPresets": false,
      "compilers": {}
    },
    {
      "folder": "c:\\Users\\xxxxx\\Cpp_starter_project_cmake\\software",
      "cmakeVersion": "unknown",
      "configured": false,
      "generator": "unknown",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": false,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    },
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    },
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    },
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[main] Configuring project: dev 
[main] Saving open files before configure/build
[driver] Start configure 
[driver] Running pre-configure checks and steps
[cmakefileapi-driver] Configuring using preset
[cmakefileapi-driver] Invoking CMake C:\Program Files\CMake\bin\cmake.EXE with arguments ["-DPARAM_PROJECT_NAME=project-name","-DPARAM_PROJECT_SUMMARY=description","-DPARAM_PROJECT_VENDOR_NAME=your-name","-DPARAM_PROJECT_VENDOR_CONTACT=contact","-DPARAM_PROJECT_VERSION_MAJOR=0","-DPARAM_PROJECT_VERSION_MINOR=0","-DPARAM_PROJECT_VERSION_PATCH=0","-DPARAM_BUILD_STANDARD_VERSION=20","-DPARAM_GENERATE_COMPILE_COMMANDS=ON","-DPARAM_ENABLE_TEST_MODULE=OFF","-DPARAM_ENABLE_CODE_ANALYSIS_MODULE=OFF","-DPARAM_ENABLE_DOC_MODULE=OFF","-DPARAM_ENABLE_EXPORT_MODULE=OFF","-DPARAM_EXPORT_NAMESPACE=MyProject","-DPARAM_INSTALL_DIRECTORY=","-DPARAM_ENABLE_PACKAGE_MODULE=OFF","-DCMAKE_BUILD_TYPE=Debug","-DCMAKE_TOOLCHAIN_FILE=C:/Users/xxxxx/Cpp_starter_project_cmake/dev/cmake/toolchains/x64-windows-mingw32-gcc.cmake","-DCMAKE_INSTALL_PREFIX=C:/Users/xxxxx/Cpp_starter_project_cmake/dev/build/install/x64-Debug-Win-GCC","-S","C:/Users/xxxxx/Cpp_starter_project_cmake/dev","-B","C:/Users/xxxxx/Cpp_starter_project_cmake/dev/build/x64-Debug-Win-GCC","-G","MinGW Makefiles"]
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" -DPARAM_PROJECT_NAME=project-name -DPARAM_PROJECT_SUMMARY=description -DPARAM_PROJECT_VENDOR_NAME=your-name -DPARAM_PROJECT_VENDOR_CONTACT=contact -DPARAM_PROJECT_VERSION_MAJOR=0 -DPARAM_PROJECT_VERSION_MINOR=0 -DPARAM_PROJECT_VERSION_PATCH=0 -DPARAM_BUILD_STANDARD_VERSION=20 -DPARAM_GENERATE_COMPILE_COMMANDS=ON -DPARAM_ENABLE_TEST_MODULE=OFF -DPARAM_ENABLE_CODE_ANALYSIS_MODULE=OFF -DPARAM_ENABLE_DOC_MODULE=OFF -DPARAM_ENABLE_EXPORT_MODULE=OFF -DPARAM_EXPORT_NAMESPACE=MyProject -DPARAM_INSTALL_DIRECTORY= -DPARAM_ENABLE_PACKAGE_MODULE=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=C:/Users/xxxxx/Cpp_starter_project_cmake/dev/cmake/toolchains/x64-windows-mingw32-gcc.cmake -DCMAKE_INSTALL_PREFIX=C:/Users/xxxxx/Cpp_starter_project_cmake/dev/build/install/x64-Debug-Win-GCC -S C:/Users/xxxxx/Cpp_starter_project_cmake/dev -B C:/Users/xxxxx/Cpp_starter_project_cmake/dev/build/x64-Debug-Win-GCC -G "MinGW Makefiles"
[proc]   with environment: {"ALLUSERSPROFILE":"C:\\ProgramData","APPDATA":"C:\\Users\\xxxxx\\AppData\\Roaming","CHROME_CRASHPAD_PIPE_NAME":"\\\\.\\pipe\\crashpad_7780_VGTCRYRWRRWFCSWB","COMPUTERNAME":"UNCLE-CHIPS","ComSpec":"C:\\Windows\\system32\\cmd.exe","CommonProgramFiles":"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files","CommonProgramW6432":"C:\\Program Files\\Common Files","DriverData":"C:\\Windows\\System32\\Drivers\\DriverData","ELECTRON_RUN_AS_NODE":"1","FPS_BROWSER_APP_PROFILE_STRING":"Internet Explorer","FPS_BROWSER_USER_PROFILE_STRING":"Default","HOMEDRIVE":"C:","HOMEPATH":"\\Users\\xxxxx","JAVA_HOME":"C:\\Program Files (x86)\\Java\\jre1.8.0_301","LOCALAPPDATA":"C:\\Users\\xxxxx\\AppData\\Local","LOGONSERVER":"\\\\UNCLE-CHIPS","NUMBER_OF_PROCESSORS":"4","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","OS":"Windows_NT","OneDrive":"C:\\Users\\xxxxx\\OneDrive","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC","PROCESSOR_ARCHITECTURE":"AMD64","PROCESSOR_IDENTIFIER":"Intel64 Family 6 Model 60 Stepping 3, GenuineIntel","PROCESSOR_LEVEL":"6","PROCESSOR_REVISION":"3c03","PSModulePath":"C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules;C:\\Program Files\\Intel\\","PUBLIC":"C:\\Users\\Public","Path":"C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files\\Broadcom\\Broadcom 802.11 Network Adapter;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;D:\\Documents\\miniconda3;D:\\Documents\\miniconda3\\Scripts;D:\\Documents\\miniconda3\\Library\\bin;C:\\msys64\\usr\\bin;C:\\msys64\\mingw64\\bin;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\Hostx64\\x64;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\Program Files\\Calibre2\\;D:\\Documents\\Software_Libraries\\doxygen\\bin;D:\\Documents\\Software_Libraries\\SFML-2.6.2\\gcc-13.1.0-mingw64\\bin;C:\\Program Files\\CMake\\bin;;C:\\Program Files\\NVIDIA Corporation\\NVIDIA App\\NvDLISR;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Users\\xxxxx\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\xxxxx\\AppData\\Local\\gitkraken\\bin","ProgramData":"C:\\ProgramData","ProgramFiles":"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)","ProgramW6432":"C:\\Program Files","SESSIONNAME":"Console","SystemDrive":"C:","SystemRoot":"C:\\Windows","TEMP":"D:\\Temp","TMP":"D:\\Temp","USERDOMAIN":"UNCLE-CHIPS","USERDOMAIN_ROAMINGPROFILE":"UNCLE-CHIPS","USERNAME":"xxxxx","USERPROFILE":"C:\\Users\\xxxxx","VSCODE_CODE_CACHE_PATH":"C:\\Users\\xxxxx\\AppData\\Roaming\\Code\\CachedData\\7d842fb85a0275a4a8e4d7e040d2625abbf7f084","VSCODE_CRASH_REPORTER_PROCESS_TYPE":"extensionHost","VSCODE_CWD":"C:\\Program Files\\Microsoft VS Code","VSCODE_ESM_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_IPC_HOOK":"\\\\.\\pipe\\9b20b522-1.105.1-main-sock","VSCODE_L10N_BUNDLE_LOCATION":"","VSCODE_NLS_CONFIG":"{\"userLocale\":\"en-us\",\"osLocale\":\"en-us\",\"resolvedLanguage\":\"en\",\"defaultMessagesFile\":\"C:\\\\Program Files\\\\Microsoft VS Code\\\\resources\\\\app\\\\out\\\\nls.messages.json\",\"locale\":\"en-us\",\"availableLanguages\":{}}","VSCODE_PID":"7780","windir":"C:\\Windows"}
[cmake] -- =================================================================
[cmake] --              πŸ—οΈ  Buildsystem Generator Project                  
[cmake] --                      of 'project-name'                  
[cmake] -- =================================================================
[cmake] -- πŸ”§ Project Info:
[cmake] --    β€’ Name             : project-name
[cmake] --    β€’ Version          : 0.0.0
[cmake] --    β€’ Author           : your-name (contact)
[cmake] --    β€’ Description      : description
[cmake] --    β€’ Generator        : MinGW Makefiles
[cmake] -- πŸ”¨ Build Settings:
[cmake] --    β€’ C++ Standard     : 20
[cmake] --    β€’ Build Type       : Debug
[cmake] --    β€’ Toolchain File   : C:/Users/xxxxx/Cpp_starter_project_cmake/dev/cmake/toolchains/x64-windows-mingw32-gcc.cmake
[cmake] --    β€’ Compile Commands : ON
[cmake] -- πŸ§ͺ Test Rules Generator:
[cmake] --    β€’ Enabled          : OFF
[cmake] -- πŸ“Š Code Analysis Rules Generator:
[cmake] --    β€’ Enabled          : OFF
[cmake] -- πŸ“š Documentation Rules Generator:
[cmake] --    β€’ Enabled          : OFF
[cmake] -- πŸ“€ Export Rules Generator:
[cmake] --    β€’ Enabled          : OFF
[cmake] --    β€’ Export Namespace : MyProject
[cmake] --    β€’ Install Dir      : 
[cmake] -- πŸ“¦ Packaging Rules Generator:
[cmake] --    β€’ Enabled          : OFF
[cmake] -- 
[cmake] -- =================================================================
[cmake] -- πŸ”¨ [1/7] Buildsystem Project Setup
[cmake] -- Project declared
[cmake] -- Project initialized
[cmake] -- 
[cmake] -- =================================================================
[cmake] -- 🧱 [2/7] Binaries Configuration
[cmake] -- Processor architecture is AMD64
[cmake] -- System name set to windows-gnu-amd64
[cmake] -- Built files will be located into 'bin/'
[cmake] -- C++ standard version set to C++20
[cmake] -- Build type set to Debug
[cmake] -- Predefined targets moved to folder 'PredefinedTargets'
[cmake] -- Compile commands export enabled (compile_commands.json will be generated)
[cmake] -- Loading CMakeTargets file
[cmake] -- Loading CMakeTargets file - done
[cmake] -- Enter in directory 'src/'
[cmake] -- Making bin target 'my-main-bin'
[cmake] --   Defining target
[cmake] --   Defining target - done
[cmake] --   Linking internal dependencies
[cmake] --   Linking internal dependencies - done
[cmake] --   Linking external dependencies
[cmake] --     Importing Qt6
[cmake] --       Import and link Qt
[cmake] --       Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
[cmake] --     Importing Qt6 - done
[cmake] --     Importing spdlog
[cmake] --       spdlog v1.15.0 not found locally, try to download it in the build-tree
[cmake] --       Build spdlog: 1.15.0
[cmake] --       Build type: Debug
[cmake] --       spdlog downloaded with success
[cmake] --       Link spdlog to the target 'my-main-bin'
[cmake] --     Importing spdlog - done
[cmake] --   Linking external dependencies - done
[cmake] -- Leave directory 'src/'
[cmake] -- 
[cmake] -- =================================================================
[cmake] -- πŸ§ͺ [3/7] Test Suite Configuration
[cmake] -- Test suite generation is disabled - skipping step
[cmake] -- 
[cmake] -- =================================================================
[cmake] -- πŸ“Š [4/7] Code Analysis Configuration
[cmake] -- Code analysis generation is disabled - skipping step
[cmake] -- 
[cmake] -- =================================================================
[cmake] -- πŸ“š [5/7] Documentation System Setup
[cmake] -- Documentation generation is disabled - skipping step
[cmake] -- 
[cmake] -- =================================================================
[cmake] -- πŸ“€ [6/7] Install Rules & Export Definitions
[cmake] -- Export generation is disabled - skipping step
[cmake] -- 
[cmake] -- =================================================================
[cmake] -- πŸ“¦ [7/7] Packaging Specification & Artifact Output
[cmake] -- Packaging generation is disabled - skipping step
[cmake] -- 
[cmake] -- =================================================================
[cmake] -- πŸ“„ Project 'project-name' Configuration Summary:
[cmake] --    β€’ C++ standard        : C++20
[cmake] --    β€’ Build configuration : Debug (MinGW Makefiles)
[cmake] --    β€’ Source-tree         : C:/Users/xxxxx/Cpp_starter_project_cmake/dev
[cmake] --    β€’ Build-tree          : C:/Users/xxxxx/Cpp_starter_project_cmake/dev/build/x64-Debug-Win-GCC
[cmake] --    β€’ Output directory    : C:/Users/xxxxx/Cpp_starter_project_cmake/dev/bin
[cmake] -- 🎯 Target 'my-main-bin' Status Checks:
[cmake] --    βš™ Target type         : executable
[cmake] --    βš™ Compile features    : cxx_std_20, cxx_thread_local, cxx_trailing_return_types
[cmake] --    βš™ Compile definitions : DEFINE_ONE=1, DEFINE_TWO=2, OPTION_1
[cmake] --    βš™ Compile options     : -Wall, -Wextra
[cmake] --    βš™ Link options        : -s, -z
[cmake] --    i Source files set (10 headers, 8 cpp)
[cmake] --    βš™ PCH file     : C:/Users/xxxxx/Cpp_starter_project_cmake/dev/include/project-name/project-name_pch.h
[cmake] --    βš™ Include dirs : C:/Users/xxxxx/Cpp_starter_project_cmake/dev/include/project-name, C:/Users/xxxxx/Cpp_starter_project_cmake/dev/src
[cmake] --    βœ” Dependency Qt6 linked
[cmake] --    βœ” Dependency spdlog linked
[cmake] -- 
[cmake] -- =================================================================
[cmake] -- βœ… Buildsystem generation completed
[cmake] -- Configuring done (1.3s)
[cmake] -- Generating done (0.2s)
[cmake] -- Build files have been written to: C:/Users/xxxxx/Cpp_starter_project_cmake/dev/build/x64-Debug-Win-GCC
[cmakefileapi-parser] Read reply folder: C:\Users\xxxxx\Cpp_starter_project_cmake\dev\build\x64-Debug-Win-GCC\.cmake\api\v1\reply
[cmakefileapi-parser] Found index files: ["cache-v2-52d29bc6c88b880c1562.json","cmakeFiles-v1-f1731bb60fce74b6e24f.json","codemodel-v2-24e15526fe9ea1f5c18f.json","directory-.-Debug-d0094a50bb2071803777.json","directory-src-Debug-c94b7c2814d5a21df52c.json","directory-_deps.spdlog-build-Debug-7bd1d690fd8077658871.json","index-2025-10-24T08-47-17-0068.json","target-my-main-bin-Debug-2c0fff53eb2f03cdd8dc.json","target-spdlog-Debug-f03b199c550e5aec1db2.json","toolchains-v1-84596c7d2fc608b8f6c9.json"]
[extension] Not updating the configuration provider because "C_Cpp.intelliSenseEngine" is set to "Disabled"
[extension] [7863] cmake.configure finished (returned 0)

Additional Information

No response

josephgarnier avatar Oct 24 '25 08:10 josephgarnier

Hi @josephgarnier, thank you for reporting this issue. We tried to check this issue in Visual Studio Code v1.105.1 + CMake Tools v1.21.36. Could you please help us check if our steps to reproduce the problem are correct? If we missed something, please let us know. Thanks.

Image

yanghhhhhhh avatar Oct 27 '25 06:10 yanghhhhhhh

Yes, your procedure seems similar to mine. I can also reproduce this issue with this minimal example and on Windows with the preset "x64-Release-Win-GCC":

cmake_minimum_required(VERSION 4.0.1 FATAL_ERROR)

project("Test Verbose Message" LANGUAGES CXX)

message(STATUS "MY STATUS MESSAGE")
message(VERBOSE "MY VERBOSE MESSAGE")
message(DEBUG "MY DEBUG MESSAGE")
message(TRACE "MY TRACE MESSAGE")

And to be completely accurate, I use the generator MinGW Makefiles.

josephgarnier avatar Oct 27 '25 17:10 josephgarnier

Hi @josephgarnier , thanks for reporting issue here! We can reproduce this issue on VS Code 1.105.1 + CMake tools 1.21.36 version.

Repro Steps:

  1. Download the attached project(Test4601.zip) and open it.
  2. Press F1 and run command "CMake: Configure". Observe the result and check if "MY DEBUG MESSAGE" is included.
  3. Open terminal and run command cmake --log-level=TRACE -S "$(pwd)" --preset "x64-Release-Linux-GCC". Observe the result.

Details please see following video: Image

FYI: @gcampbell-msft

yanghhhhhhh avatar Oct 28 '25 01:10 yanghhhhhhh

Hi @josephgarnier ,

I hope the message finds you well. Thank you for raising this detailed issue. The behaviour you have observed highlights an important and sometimes subtle distinction between two different logging systems.

To clarify, there are two separate layers involved:

  1. The CMake's own log level: which controls the output of message(VERBOSE "verbose text") and message(TRACE "...") statements within your CMakeLists.txt. This level is set by arguments passed directly to the CMake executable (e.g., --log-level=TRACE).
  2. The vscode-cmake-tools extension's internal log level, configured via the cmake.loggingLevel user settings. This setting controls the verbosity of the extension's own operational messages and diagnostics, but it does not affect the log level of the underlying CMake process it invokes.

Therefore, when you run cmake --log-level=TRACE ... in a terminal, you are directly setting CMake's log level. When using the "Configure" button in the extension, the CMake process is launched by the extension, which does not automatically apply a log-level argument based on the cmake.loggingLevel setting.

A Current Workaround:

To achieve the desired result of seeing CMake VERBOSE/TRACE messages during configuration within VS Code, you can explicitly pass the argument to CMake through the vscode-cmake-tools extension. This can be done by adding the following to your VS Code user or workspace settings:

"cmake.configureArgs":[
  "--log-level=TRACE"
]

This settings instructs the extension to append --log-level=TRACE to every CMake configure command it runs, effectively replicating your successful terminal command.

Image

DehanLUO avatar Dec 16 '25 02:12 DehanLUO

Hi @DehanLUO,

Okay, that makes sense. Thanks for explaining.

josephgarnier avatar Dec 16 '25 15:12 josephgarnier