Skip to content

Commit

Permalink
fix: do not printPolicy if logs disabled (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nchalenko authored Oct 1, 2022
1 parent fc8ef73 commit bdf2a6c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/org/casbin/jcasbin/main/CoreEnforcer.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ public void loadPolicy() {
model.sortPoliciesByPriority();

clearRmMap();
model.printPolicy();
if (Util.enableLog) {
model.printPolicy();
}
if (autoBuildRoleLinks) {
buildRoleLinks();
}
Expand All @@ -285,7 +287,9 @@ public void loadFilteredPolicy(Object filter) {
model.sortPoliciesByPriority();

initRmMap();
model.printPolicy();
if (Util.enableLog) {
model.printPolicy();
}
if (autoBuildRoleLinks) {
buildRoleLinks();
}
Expand Down

0 comments on commit bdf2a6c

Please sign in to comment.