Log & Error Handling
로깅
Casbin은 기본적으로 내장된 log를 사용하여 콘솔에 로그를 출력합니다, 예를 들면:
2017/07/15 19:43:56 [Request: alice, data1, read ---> true]
기본적으로 로깅은 활성화되어 있지 않습니다. Enforcer.EnableLog() 또는 NewEnforcer()의 마지막 매개변수를 통해 이를 토글할 수 있습니다.
For Golang: We already support logging the model, enforce request, role, and policy in Golang. Casbin에 대한 로깅을 위해 자신만의 로그를 정의할 수 있습니다.
For Python: PyCasbin leverages the default Python logging mechanism. PyCasbin makes a call to logging.getLogger() to set the logger. No special logging configuration is needed other than initializing the logger in the parent application. If no logging is initialized within the parent application, you will not see any log messages from PyCasbin. At the same time, when you enable logs in PyCasbin, you can specify the logging configuration through the parameter logging_config. If no configuration is specified, it will use the default log configuration. For other PyCasbin extensions, you can refer to the Django logging docs if you are a Django user. 다른 Python 사용자들은 로거를 구성하기 위해 Python 로깅 문서를 참조해야 합니다.