Skip to content

Commit

Permalink
policy/opa: use Veraison logging
Browse files Browse the repository at this point in the history
Use Veraison logging framework for logging OPA engine output.

Signed-off-by: Sergei Trofimov <[email protected]>
  • Loading branch information
setrofim committed Jul 19, 2023
1 parent d7cc2bf commit 704fd40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions policy/opa.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"encoding/json"
"errors"
"fmt"
"log"

"github.com/open-policy-agent/opa/rego"
"github.com/spf13/viper"
"github.com/veraison/ear"
"github.com/veraison/services/log"
)

var ErrBadOPAResult = errors.New("bad result update from policy")
Expand Down Expand Up @@ -59,7 +59,7 @@ func (o *OPA) Evaluate(
rego.Module("policy.rego", policy),
rego.Input(input),
rego.Query("outcome"),
rego.Dump(log.Writer()),
rego.Dump(log.NamedWriter("opa", log.DebugLevel)),
)

resultSet, err := rego.Eval(ctx)
Expand Down

0 comments on commit 704fd40

Please sign in to comment.