Replies: 3 comments 1 reply
-
Would it be any more beneficial to have a structure like |
Beta Was this translation helpful? Give feedback.
-
Okay, fair enough. Then, this discussion would be more productive if you address the rationale (goals and non-goals) of the proposal. As the main purpose to emit them are not for publishing messages to subscribers (say, front-ends), but for recording debug logs, its design probably should be more similar to traditional application logging frameworks (e.g., Serilog, Log4j, Python's |
Beta Was this translation helpful? Give feedback.
-
I replaced the description with a new design and implementation. |
Beta Was this translation helpful? Give feedback.
-
This discussion wants to suggest introducing
IActionContext.EmitEvent
method, a method to leave logs asTxExecution
. It was inspired fromemit <EVENT>
syntax in solidity (i.e. Ethereum).The event logs will help debugging the transaction and it'll help to show them in Web interface by saving them as transaction result and providing them through GraphQL. (Etherscan - Logs example)
Expected changes
Added APIs
System.Action<string> IActionContext.PutLog { get; }
.IReadOnlyList<string> ActionEvaluation.Logs { get; }
IReadOnlyList<IReadOnlyList<string>> TxExecution.ActionLogsList { get; }
IReadOnlyList<IReadOnlyList<string>> TxExecution.ActionLogsList { get; }
query.explorer.transactionQuery.transactionResult.actionLogsList
field (with[[String!]!]
type).Usage in actions
Implementation
See #2505.
Beta Was this translation helpful? Give feedback.
All reactions