func (l *Logger) RemoveListener(flag, listenerName string) error {
	l.Lock()
	defer l.Unlock()

	if l.Listeners == nil {
		return nil
	}

	listeners, ok := l.Listeners[flag]
	if !ok {
		return nil
	}

	worker, ok := listeners[listenerName]
	if !ok {
		return nil
	}
	if err := worker.Stop(); err != nil {
		return err
	}
	delete(listeners, listenerName)
	if len(listeners) == 0 {
		delete(l.Listeners, flag)
	}
	return nil
}
// RemoveListener clears a specific listener for a Flag.
RemoveListener clears a specific listener for a Flag.
// RemoveListener clears a specific listener for a Flag .
func (l *Logger) RemoveListener(flag, listenerName string) error {
	l.Lock()
	defer l.Unlock()
	if l.Listeners == nil {
		return nil
	}
	listeners, ok := l.Listeners[flag]
	if !ok {
		return nil
	}
	worker, ok := listeners[listenerName]
	if !ok {
		return nil
	}
	if err := worker.Stop(); err != nil {
		return err
	}
	delete(listeners, listenerName)
	if len(listeners) == 0 {
		delete(l.Listeners, flag)
	}
	return nil
}
func ( l * Logger ) RemoveListener ( flag , listenerName string ) error { l . Lock ( ) defer l . Unlock ( ) if l . Listeners == nil { return nil } listeners , ok := l . Listeners [ flag ] if ! ok { return nil } worker , ok := listeners [ listenerName ] if ! ok { return nil } if err := worker . Stop ( ) ; err != nil { return err } delete ( listeners , listenerName ) if len ( listeners ) == 0 { delete ( l . Listeners , flag ) } return nil }
RemoveListener clears a specific listener for a Flag.
RemoveListener clears a specific listener for a Flag .