Gator CLI to render print statements output from rego code to stdout
Just hoping to see if we can view print statements in rego code to be rendered as output when using Gator CLI so that debugging/developing a policy can be much faster.
Slack Conversation - https://openpolicyagent.slack.com/archives/CDTN970AX/p1691700736253819
It looks like print statements are not currently printed.
An interim option would be to use the trace() statement and set the --trace flag, which should inject text into the Rego trace. This is probably a better method for development/debug, as more contextual information is provided.
For potential implementation...
Printing could be enabled by setting the appropriate PrintEnabled() and PrintHook() arguments in the Rego driver:
https://github.com/open-policy-agent/frameworks/blob/e24af74adbaeb6c3e9e71d7ef88d63389fa6a3fb/constraint/pkg/client/drivers/rego/args.go#L63-L77
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
not stale
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.