Skip to content

Commit

Permalink
fix: Set the default log level to warning (#261)
Browse files Browse the repository at this point in the history
* fix: update core_enforcer.py

* fix: update core_enforcer.py
  • Loading branch information
Nekotoxin authored Jun 22, 2022
1 parent d687d8c commit 9a48e5d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion casbin/core_enforcer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class CoreEnforcer:

def __init__(self, model=None, adapter=None):
self.logger = logging.getLogger(__name__)
# if want to see more detail logs, change log level to info or debug
self.logger.setLevel(logging.WARNING)
if isinstance(model, str):
if isinstance(adapter, str):
self.init_with_file(model, adapter)
Expand Down Expand Up @@ -443,7 +445,8 @@ def enforce_ex(self, *rvals):
if result:
self.logger.info(req_str)
else:
# leaving this in error for now, if it's very noise this can be changed to info or debug
# leaving this in error for now, if it's very noise this can be changed to info or debug,
# or change the log level
self.logger.error(req_str)

explain_rule = []
Expand Down

0 comments on commit 9a48e5d

Please sign in to comment.