func (t *Tracer) listen() {
	t.wg.Add(1)
	var event model.ProbeEvent
	var ok bool
	for {
		select {
		case <-t.stop:
			t.wg.Done()
			return
		case event, ok = <-t.EventChan:
			if !ok {
				t.wg.Done()
				return
			}
			entry := event.GetLogEntry()
			ns := event.GetNamespaceCacheData()
			if ns != nil {
				entry = entry.WithField("namespace", ns.Name)
			}
			ps := event.GetProcessCacheData()
			if ps != nil {
				entry = entry.WithField("process", ps.BinaryPath)
			}
			entry.Info(event.GetMessage())
		}
	}
}
// listen - Wait for events and print them
Wait for events and print them
// listen - Wait for events and print them
func (t *Tracer) listen() {
	t.wg.Add(1)
	var event model.ProbeEvent
	var ok bool
	for {
		select {
		case <-t.stop:
			t.wg.Done()
			return
		case event, ok = <-t.EventChan:
			if !ok {
				t.wg.Done()
				return
			}
			entry := event.GetLogEntry()
			ns := event.GetNamespaceCacheData()
			if ns != nil {
				entry = entry.WithField("namespace", ns.Name)
			}
			ps := event.GetProcessCacheData()
			if ps != nil {
				entry = entry.WithField("process", ps.BinaryPath)
			}
			entry.Info(event.GetMessage())
		}
	}
}
func ( t * Tracer ) listen ( ) { t . wg . Add ( 1 ) var event model . ProbeEvent var ok bool for { select { case <- t . stop : t . wg . Done ( ) return case event , ok = <- t . EventChan : if ! ok { t . wg . Done ( ) return } entry := event . GetLogEntry ( ) ns := event . GetNamespaceCacheData ( ) if ns != nil { entry = entry . WithField ( " " , ns . Name ) } ps := event . GetProcessCacheData ( ) if ps != nil { entry = entry . WithField ( " " , ps . BinaryPath ) } entry . Info ( event . GetMessage ( ) ) } } }
Wait for events and print them
Wait for events and print them