MCPcopy
hub / github.com/apache/casbin / onLogBeforeEventInSavePolicy

Method onLogBeforeEventInSavePolicy

util_log.go:79–89  ·  view source on GitHub ↗

onLogBeforeEventInSavePolicy initializes logging for SavePolicy operation with rule count.

()

Source from the content-addressed store, hash-verified

77
78// onLogBeforeEventInSavePolicy initializes logging for SavePolicy operation with rule count.
79func (e *Enforcer) onLogBeforeEventInSavePolicy() *log.LogEntry {
80 if e.logger == nil {
81 return nil
82 }
83 logEntry := &log.LogEntry{
84 EventType: log.EventSavePolicy,
85 RuleCount: countModelRules(e.model),
86 }
87 _ = e.logger.OnBeforeEvent(logEntry)
88 return logEntry
89}
90
91// onLogAfterEventInSavePolicy finalizes logging for SavePolicy operation.
92func (e *Enforcer) onLogAfterEventInSavePolicy(logEntry *log.LogEntry) {

Callers 1

SavePolicyMethod · 0.95

Calls 2

countModelRulesFunction · 0.85
OnBeforeEventMethod · 0.65

Tested by

no test coverage detected