In nrf connect for vscode, how to store the project build log in a file

I would like to automatically save the contents of the log that `west` outputs to the terminal for a project build to a .log file;

When I click on `build` under the `action` column of `nrf connect for vscode`, I see that the code that is executed is :

"C:\windows\system32\cmd.exe /d /s /c "west build --build-dir e:/ nordic/nordic-connect-sdk-demo/Peripherals/15_usb/usb_hid_transparent/build e:/nordic/nordic-connect-sdk-demo/Peripherals/15_usb/ usb_hid_transparent --pristine --board nrf52840dk_nrf52840 --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCACHED_CONF_FILE=e:/nordic/ nordic-connect-sdk-demo/Peripherals/15_usb/usb_hid_transparent/prj.conf"

I would like to be able to add " > build.log 2>&1" at the end of the execution.

This is what it looks like.

"C:\windows\system32\cmd.exe /d /s /c "west build --build-dir e:/nordic/nordic-connect-sdk-demo/Peripherals/15_usb/usb_hid_transparent --pristine --nordic/nordic-connect-sdk-demo/Peripherals/15_usb/usb_hid_transparent transparent/build e:/nordic/nordic-connect-sdk-demo/Peripherals/15_usb/usb_hid_transparent --pristine --board nrf52840dk_nrf52840 --no- sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCACHED_CONF_FILE=e:/nordic/nordic-connect-sdk-demo/Peripherals/15_usb/usb_hid_transparent/ prj.conf  > build.log 2>&1"

I've tried it, and if I run this code directly from the command line, it produces a `build.log` file that I want;

However, I'd like to be able to change the configuration of `nrf connect for vscode` to generate this `build.log` file every time I click on `build` under the `action` column of `nrf connect for vscode`.

I hope I can get your help. Thank you.

Related