func (l *Logger) Listen(flag, listenerName string, listener Listener) {
	l.Lock()
	defer l.Unlock()

	if l.Listeners == nil {
		l.Listeners = make(map[string]map[string]*Worker)
	}
	if l.Listeners[flag] == nil {
		l.Listeners[flag] = make(map[string]*Worker)
	}

	eventListener := NewWorker(listener)
	l.Listeners[flag][listenerName] = eventListener
	go func() { _ = eventListener.Start() }()
	<-eventListener.NotifyStarted()
}
// Listen adds a listener for a given flag.
Listen adds a listener for a given flag.
// Listen adds a listener for a given flag .
func (l *Logger) Listen(flag, listenerName string, listener Listener) {
	l.Lock()
	defer l.Unlock()
	if l.Listeners == nil {
		l.Listeners = make(map[string]map[string]*Worker)
	}
	if l.Listeners[flag] == nil {
		l.Listeners[flag] = make(map[string]*Worker)
	}
	eventListener := NewWorker(listener)
	l.Listeners[flag][listenerName] = eventListener
	go func() { _ = eventListener.Start() }()
	<-eventListener.NotifyStarted()
}
func ( l * Logger ) Listen ( flag , listenerName string , listener Listener ) { l . Lock ( ) defer l . Unlock ( ) if l . Listeners == nil { l . Listeners = make ( map [ string ] map [ string ] * Worker ) } if l . Listeners [ flag ] == nil { l . Listeners [ flag ] = make ( map [ string ] * Worker ) } eventListener := NewWorker ( listener ) l . Listeners [ flag ] [ listenerName ] = eventListener go func ( ) { _ = eventListener . Start ( ) } ( ) <- eventListener . NotifyStarted ( ) }
Listen adds a listener for a given flag.
Listen adds a listener for a given flag .