Documentation ¶
Index ¶
- func LogEnforce(matcher string, request []interface{}, result bool, explains [][]string)
- func LogError(err error, msg ...string)
- func LogModel(model [][]string)
- func LogPolicy(policy map[string][][]string)
- func LogRole(roles []string)
- func SetLogger(l Logger)
- type DefaultLogger
- func (l *DefaultLogger) EnableLog(enable bool)
- func (l *DefaultLogger) IsEnabled() bool
- func (l *DefaultLogger) LogEnforce(matcher string, request []interface{}, result bool, explains [][]string)
- func (l *DefaultLogger) LogError(err error, msg ...string)
- func (l *DefaultLogger) LogModel(model [][]string)
- func (l *DefaultLogger) LogPolicy(policy map[string][][]string)
- func (l *DefaultLogger) LogRole(roles []string)
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogEnforce ¶
LogEnforce logs the enforcer information.
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
DefaultLogger is the implementation for a Logger using golang log.
func (*DefaultLogger) EnableLog ¶
func (l *DefaultLogger) EnableLog(enable bool)
func (*DefaultLogger) IsEnabled ¶
func (l *DefaultLogger) IsEnabled() bool
func (*DefaultLogger) LogEnforce ¶
func (l *DefaultLogger) LogEnforce(matcher string, request []interface{}, result bool, explains [][]string)
func (*DefaultLogger) LogError ¶
func (l *DefaultLogger) LogError(err error, msg ...string)
func (*DefaultLogger) LogModel ¶
func (l *DefaultLogger) LogModel(model [][]string)
func (*DefaultLogger) LogPolicy ¶
func (l *DefaultLogger) LogPolicy(policy map[string][][]string)
func (*DefaultLogger) LogRole ¶
func (l *DefaultLogger) LogRole(roles []string)
type Logger ¶
type Logger interface { // EnableLog controls whether print the message. EnableLog(bool) // IsEnabled returns if logger is enabled. IsEnabled() bool // LogModel log info related to model. LogModel(model [][]string) // LogEnforce log info related to enforce. LogEnforce(matcher string, request []interface{}, result bool, explains [][]string) // LogRole log info related to role. LogRole(roles []string) // LogPolicy log info related to policy. LogPolicy(policy map[string][][]string) // LogError log info relate to error LogError(err error, msg ...string) }
Logger is the logging interface implementation.
Click to show internal directories.
Click to hide internal directories.