[Feature] Allow of enabling of human-friendly logging for test runs (--trace-to json:log) as a debug option
Feature description
--trace-to json:log decoding is much more user friendly for python tests. Then we can see logs such as:
...
[MatterTest] 08-14 09:13:07.482 INFO "payload" :
[MatterTest] 08-14 09:13:07.482 INFO {
[MatterTest] 08-14 09:13:07.482 INFO "decoded" :
[MatterTest] 08-14 09:13:07.482 INFO {
[MatterTest] 08-14 09:13:07.482 INFO "report_data" :
[MatterTest] 08-14 09:13:07.482 INFO {
[MatterTest] 08-14 09:13:07.482 INFO "attribute_reports" :
[MatterTest] 08-14 09:13:07.483 INFO {
[MatterTest] 08-14 09:13:07.483 INFO "Anonymous<0>" :
[MatterTest] 08-14 09:13:07.483 INFO {
[MatterTest] 08-14 09:13:07.483 INFO "attribute_data" :
[MatterTest] 08-14 09:13:07.483 INFO {
[MatterTest] 08-14 09:13:07.483 INFO "BridgedDeviceBasicInformation::uniqueID" : "\"4CED04A3961C4572\"",
[MatterTest] 08-14 09:13:07.483 INFO "data_version" : "2078803658",
[MatterTest] 08-14 09:13:07.483 INFO "path" :
[MatterTest] 08-14 09:13:07.483 INFO {
[MatterTest] 08-14 09:13:07.483 INFO "attribute_id" : "18 == 'uniqueID'",
[MatterTest] 08-14 09:13:07.483 INFO "cluster_id" : "57 == 'BridgedDeviceBasicInformation'",
[MatterTest] 08-14 09:13:07.483 INFO "endpoint_id" : "2"
[MatterTest] 08-14 09:13:07.483 INFO }
[MatterTest] 08-14 09:13:07.483 INFO }
[MatterTest] 08-14 09:13:07.483 INFO }
[MatterTest] 08-14 09:13:07.483 INFO },
[MatterTest] 08-14 09:13:07.483 INFO "interaction_model_revison" : "11",
[MatterTest] 08-14 09:13:07.483 INFO "subscription_id" : "2963187484"
[MatterTest] 08-14 09:13:07.483 INFO }
[MatterTest] 08-14 09:13:07.483 INFO },
[MatterTest] 08-14 09:13:07.483 INFO "hex" : "1526001CA79EB036011535012600CA06E87B3701240202240339240412182C02103443454430344133393631433435373218181824FF0B18",
[MatterTest] 08-14 09:13:07.483 INFO "size" : 56
[MatterTest] 08-14 09:13:07.483 INFO },
[MatterTest] 08-14 09:13:07.483 INFO "payloadHeader" :
[MatterTest] 08-14 09:13:07.484 INFO {
...
which is very human-readable, especially the decoded cluster content and payload.
This log format should be possible to enable via TH config.
See https://github.com/project-chip/matter-test-scripts/issues/335
Use Cases
- Easier debugging and analysis of test results
Test Cases
No response
Additional Information
Found in 1.4 TE2
Hi @tcarmelveilleux there is an issue for the frontend in order to present the log in the UI in a human-friendly format: https://github.com/project-chip/certification-tool/issues/356
If you download the execution log, the log is presented in a pretty format, while we are still not able to present the log in the UI in a human-friendly format.
In addition, there is one option in project config that you can disable the trace log, in case you don't need to much detail in the logs.
--trace-to is part of what command?
@fabiowmm, @tcarmelveilleux, can you provide instructions to reproduce?
Hi @raul-marquez-csa, the --trace-to argument is enabled, by default. At project configuration screen you will be able to turn on/off this argument by setting the trace_log to true/false.
@tcarmelveilleux
From our conversation
- We need a way to ensure that the executed command line for the Python tests have --trace-to json:log on it by default
- The finding was that the python tests did not have it on the command line when launched from TH
- This can currently be viewed in the black log at the top when you start the run, also in the downloaded logs
Anything I missed?
From the title: "human-friendly": Does human friendly mean in json format? what does it currently look like? "debug option": This to me implies it can be toggled (but on by default), is this toggle expected to be some switch in the TH UI? Per project? Per test case?
After frontend PR merged, this is how it looks like now:
@tcarmelveilleux, from the screenshot shared by @rquidute, does that resolve the issue?
Yep, looks great! Can you enable/disable it or is it always enabled? In any case, the screenshot is what was needed.
Hi @tcarmelveilleux it is always enabled 👍