MCPcopy Index your code
hub / github.com/apache/casbin / SetEventTypes

Method SetEventTypes

log/default_logger.go:51–57  ·  view source on GitHub ↗

SetEventTypes sets the event types that should be logged. Only events matching these types will have IsActive set to true.

(eventTypes []EventType)

Source from the content-addressed store, hash-verified

49// SetEventTypes sets the event types that should be logged.
50// Only events matching these types will have IsActive set to true.
51func (l *DefaultLogger) SetEventTypes(eventTypes []EventType) error {
52 l.eventTypes = make(map[EventType]bool)
53 for _, et := range eventTypes {
54 l.eventTypes[et] = true
55 }
56 return nil
57}
58
59// OnBeforeEvent is called before an event occurs.
60// It sets the StartTime and determines if the event should be active based on configured event types.

Callers 1

TestSetEventTypesFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestSetEventTypesFunction · 0.76