apps/docs/src/guide/scripts/logs.md
When you log a value within a script, you can generates a log entry that is added to the log receipt, and the variable type is recorded in the script's ABI. The SDK enables you to parse these values into TypeScript types.
Consider the following example script:
<<< @/../../docs/sway/script-log-simple/src/main.sw#full{rust:line-numbers}
To access the logged values in TypeScript, use the logs property in the response of a script call.
<<< @./snippets/script-log-simple.ts#full{ts:line-numbers}
Consider the following example script:
<<< @/../../docs/sway/script-log-with-contract/src/main.sw#full{rust:line-numbers}
To access the fine-grained logs for each contract, use the groupedLogs property from the script call response.
<<< @./snippets/script-log-with-contract.ts#full{ts:line-numbers}
Although Scripts don't have IDs/addresses, they can still call contracts and generate logs, so we use a zeroed-out (hexadecimal) address as their key instead.