Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create GoDoc example for using rego.Tracer #1002

Closed
tsandall opened this issue Oct 11, 2018 · 0 comments
Closed

Create GoDoc example for using rego.Tracer #1002

tsandall opened this issue Oct 11, 2018 · 0 comments

Comments

@tsandall
Copy link
Member

tsandall commented Oct 11, 2018

We don't have an example that shows how to enable tracing--but this comes up often enough that it would be good to have something to link to. We should at least have a GoDoc example that shows how to run query evaluation with tracing enabled.

Something like: https://github.com/open-policy-agent/opa/blob/master/rego/example_test.go#L20 but with:

buf := topdown.NewBufferTracer()

r := rego.New(
  // other args
  rego.Tracer(buf),
)

// call eval

topdown.PrettyTrace(os.Stdout, *buf)
kichristensen added a commit to kichristensen/opa that referenced this issue Oct 13, 2018
tsandall pushed a commit that referenced this issue Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant