forc test should show decoded logs as default
Currently users need to type forc test --decode --logs in order to see human readable output from the logs.
We should have this be the default and instead have a flag that will instead show the raw logging.
There is couple of details we should iron before implementing this. Currently if the test do not fail we do not show any logs to the user if they do not specifically ask for it with --logs. Should we keep this behaviour, given that we will by default show human decodable logs? I think we should only be seeing the debug prompts if the test fails or the users asks for it explicitly. Which means keeping --logs as it is. This way we would be removing --decode flag and decode logs by default. Only show raw receipt, if either:
- Receipt is a log, but we cannot decode for some reason,
- It is not a log receipt
- Or user asked for
--raw-logs.
This brings me to the second point. I think we are using the term log in a sense that might be confusing. We have receipts coming from VM and some of them are log receipts. --logs should be named --receipts in my opinion in this regard and if present we should show the receipts we got from vm.
This way overall design would be:
-
forc testand the code haslogs in it, and test fails -> show human readable logs. -
forc test --receipts, whether test fails or not -> all receipts are shown, logs are decoded. -
forc test --receipts --raw-logs, whether test fails or not -> all receipts are shown, logs are note decoded.
Let's try to get a design first, the implementation should be fairly easy. We just need to move couple of ifs around :)
Related https://github.com/FuelLabs/sway/issues/6015
I believe this is closed by https://github.com/FuelLabs/sway/pull/6528
Feel free to reopen if there's anything missing.