func (l *Logger) DrainContext(ctx context.Context) {
	for _, workers := range l.Listeners {
		for _, worker := range workers {
			_ = worker.StopContext(ctx)
			worker.Reset()

			notifyStarted := worker.NotifyStarted()
			go func(w *Worker) {
				_ = w.Start()
			}(worker)

			// Wait for worker to start
			select {
			case <-notifyStarted:
			case <-ctx.Done():
			}
		}
	}
}
// DrainContext waits for the logger to finish its queue of events with a given context.
DrainContext waits for the logger to finish its queue of events with a given context.
// DrainContext waits for the logger to finish its queue of events with a given context .
func (l *Logger) DrainContext(ctx context.Context) {
	for _, workers := range l.Listeners {
		for _, worker := range workers {
			_ = worker.StopContext(ctx)
			worker.Reset()
			notifyStarted := worker.NotifyStarted()
			go func(w *Worker) {
				_ = w.Start()
			}(worker)
			select {
			case <-notifyStarted:
			case <-ctx.Done():
			}
		}
	}
}
func ( l * Logger ) DrainContext ( ctx context . Context ) { for _ , workers := range l . Listeners { for _ , worker := range workers { _ = worker . StopContext ( ctx ) worker . Reset ( ) notifyStarted := worker . NotifyStarted ( ) go func ( w * Worker ) { _ = w . Start ( ) } ( worker ) select { case <- notifyStarted : case <- ctx . Done ( ) : } } } }
DrainContext waits for the logger to finish its queue of events with a given context.
DrainContext waits for the logger to finish its queue of events with a given context .
// Wait for worker to start