SetEventTypes sets the event types that should be logged. Only events matching these types will have IsActive set to true.
(eventTypes []EventType)
| 49 | // SetEventTypes sets the event types that should be logged. |
| 50 | // Only events matching these types will have IsActive set to true. |
| 51 | func (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. |
no outgoing calls