You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed there are couple log.Print in loading model and policy config. There should environmental variable to control this log so it will can give developer to switch it on/off between dev and prod version.
The text was updated successfully, but these errors were encountered:
funcTestEnableLog(t*testing.T) {
e:=NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv", true)
// The log is enabled by default, so the above is the same with:// e := NewEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")testEnforce(t, e, "alice", "data1", "read", true)
testEnforce(t, e, "alice", "data1", "write", false)
testEnforce(t, e, "alice", "data2", "read", false)
testEnforce(t, e, "alice", "data2", "write", false)
testEnforce(t, e, "bob", "data1", "read", false)
testEnforce(t, e, "bob", "data1", "write", false)
testEnforce(t, e, "bob", "data2", "read", false)
testEnforce(t, e, "bob", "data2", "write", true)
// The log can also be enabled or disabled at run-time.e.EnableLog(false)
testEnforce(t, e, "alice", "data1", "read", true)
testEnforce(t, e, "alice", "data1", "write", false)
testEnforce(t, e, "alice", "data2", "read", false)
testEnforce(t, e, "alice", "data2", "write", false)
testEnforce(t, e, "bob", "data1", "read", false)
testEnforce(t, e, "bob", "data1", "write", false)
testEnforce(t, e, "bob", "data2", "read", false)
testEnforce(t, e, "bob", "data2", "write", true)
}
I noticed there are couple log.Print in loading model and policy config. There should environmental variable to control this log so it will can give developer to switch it on/off between dev and prod version.
The text was updated successfully, but these errors were encountered: