func (l *Logger) Dispatch(ctx context.Context, e Event) {
	if e == nil {
		return
	}
	flag := e.GetFlag()
	if !l.IsEnabled(flag) {
		return
	}
	if !l.Scopes.IsEnabled(GetPath(ctx)...) {
		return
	}

	if !IsSkipTrigger(ctx) {
		var filters map[string]Filter
		var listeners map[string]*Worker
		l.Lock()
		if l.Filters != nil {
			if flagFilters, ok := l.Filters[flag]; ok {
				filters = flagFilters
			}
		}
		if l.Listeners != nil {
			if flagListeners, ok := l.Listeners[flag]; ok {
				listeners = flagListeners
			}
		}
		l.Unlock()

		var shouldFilter bool
		for _, filter := range filters {
			e, shouldFilter = filter(ctx, e)
			if shouldFilter {
				return
			}
		}
		for _, listener := range listeners {
			listener.Work <- EventWithContext{ctx, e}
		}
	}

	l.Write(ctx, e)
}
// Dispatch fires the listeners for a given event asynchronously, and writes the event to the output.
// The invocations will be queued in a work queue per listener.
// There are no order guarantees on when these events will be processed across listeners.
// This call will not block on the event listeners, but will block on the write.
Dispatch fires the listeners for a given event asynchronously, and writes the event to the output.
The invocations will be queued in a work queue per listener.
There are no order guarantees on when these events will be processed across listeners.
This call will not block on the event listeners, but will block on the write.
// Dispatch fires the listeners for a given event asynchronously and writes the event to the output . // The invocations will be queued in a work queue per listener . // There are no order guarantees on when these events will be processed across listeners . // This call will not block on the event listeners but will block on the write .
func (l *Logger) Dispatch(ctx context.Context, e Event) {
	if e == nil {
		return
	}
	flag := e.GetFlag()
	if !l.IsEnabled(flag) {
		return
	}
	if !l.Scopes.IsEnabled(GetPath(ctx)...) {
		return
	}
	if !IsSkipTrigger(ctx) {
		var filters map[string]Filter
		var listeners map[string]*Worker
		l.Lock()
		if l.Filters != nil {
			if flagFilters, ok := l.Filters[flag]; ok {
				filters = flagFilters
			}
		}
		if l.Listeners != nil {
			if flagListeners, ok := l.Listeners[flag]; ok {
				listeners = flagListeners
			}
		}
		l.Unlock()
		var shouldFilter bool
		for _, filter := range filters {
			e, shouldFilter = filter(ctx, e)
			if shouldFilter {
				return
			}
		}
		for _, listener := range listeners {
			listener.Work <- EventWithContext{ctx, e}
		}
	}
	l.Write(ctx, e)
}
func ( l * Logger ) Dispatch ( ctx context . Context , e Event ) { if e == nil { return } flag := e . GetFlag ( ) if ! l . IsEnabled ( flag ) { return } if ! l . Scopes . IsEnabled ( GetPath ( ctx ) ... ) { return } if ! IsSkipTrigger ( ctx ) { var filters map [ string ] Filter var listeners map [ string ] * Worker l . Lock ( ) if l . Filters != nil { if flagFilters , ok := l . Filters [ flag ] ; ok { filters = flagFilters } } if l . Listeners != nil { if flagListeners , ok := l . Listeners [ flag ] ; ok { listeners = flagListeners } } l . Unlock ( ) var shouldFilter bool for _ , filter := range filters { e , shouldFilter = filter ( ctx , e ) if shouldFilter { return } } for _ , listener := range listeners { listener . Work <- EventWithContext { ctx , e } } } l . Write ( ctx , e ) }
Dispatch fires the listeners for a given event asynchronously, and writes the event to the output.
Dispatch fires the listeners for a given event asynchronously and writes the event to the output .