Hello,
Not sure if this is a missing feature or just something that is not working properly on latest versions, but seems that when you setup the RTT configuration in the launch.json file to enable the Timestamp and also log to file features, the timestamp is shown only in the terminal, but not added to the log file.
Here is the launch.json configuration:
{
"version": "0.2.0",
"configurations":
[
{
"name": "Debug JLink",
"type": "cortex-debug",
"request": "launch",
"runToEntryPoint": "main",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}/build/project_name.elf",
"svdFile": "${workspaceRoot}/project/svd/STM32L4x1.svd",
"armToolchainPath": "/usr/bin/",
"servertype": "jlink",
"interface": "swd",
"device": "STM32L431CC",
"serverpath": "/opt/SEGGER/JLink/JLinkGDBServerCLExe",
"rttConfig":
{
"enabled": true,
"address": "auto",
"decoders":
[
{
"label": "RTT - STDOUT",
"port": 0,
"type": "console",
"timestamp": true,
"logfile": "${workspaceRoot}/build/rtt.log"
}
]
}
}
]
}
What I get from the VSCode Terminal is:
[2022-09-08T17:18:54.963Z, +251016ms] Hello World
[2022-09-08T17:18:54.984Z, +251037ms] Good bye
What is stored in the rtt.log file:
Note: Issue tested in Cortex-Debug v1.6.2 and VSCode 1.71.0 Linux x64.
In case it is a missing feature, could it be considered/discussed as a feature request?
It will be a very nice to have feature.
Best Regards.
Hello,
Not sure if this is a missing feature or just something that is not working properly on latest versions, but seems that when you setup the RTT configuration in the launch.json file to enable the Timestamp and also log to file features, the timestamp is shown only in the terminal, but not added to the log file.
Here is the launch.json configuration:
{ "version": "0.2.0", "configurations": [ { "name": "Debug JLink", "type": "cortex-debug", "request": "launch", "runToEntryPoint": "main", "cwd": "${workspaceRoot}", "executable": "${workspaceRoot}/build/project_name.elf", "svdFile": "${workspaceRoot}/project/svd/STM32L4x1.svd", "armToolchainPath": "/usr/bin/", "servertype": "jlink", "interface": "swd", "device": "STM32L431CC", "serverpath": "/opt/SEGGER/JLink/JLinkGDBServerCLExe", "rttConfig": { "enabled": true, "address": "auto", "decoders": [ { "label": "RTT - STDOUT", "port": 0, "type": "console", "timestamp": true, "logfile": "${workspaceRoot}/build/rtt.log" } ] } } ] }What I get from the VSCode Terminal is:
What is stored in the rtt.log file:
Note: Issue tested in Cortex-Debug v1.6.2 and VSCode 1.71.0 Linux x64.
In case it is a missing feature, could it be considered/discussed as a feature request?
It will be a very nice to have feature.
Best Regards.