github.com/zartbot/goflow@v0.0.0-20221001080520-456f7dfad288/service/output/console_log.go (about)

     1  package output
     2  
     3  import (
     4  	"encoding/json"
     5  	"fmt"
     6  
     7  	"github.com/zartbot/goflow/datarecord"
     8  )
     9  
    10  func ConsoleLog(prefix string, dfchan chan *datarecord.DataFrame) {
    11  	for {
    12  		d := <-dfchan
    13  		RecordMap(d)
    14  		d.Print(prefix)
    15  
    16  		if (d.Type != "NULL") && (d.Type != "OptionTemplate") {
    17  
    18  			fmt.Println("------------")
    19  			r, _ := json.Marshal(d.RecordList())
    20  			fmt.Println(string(r))
    21  			fmt.Println("------------")
    22  
    23  		}
    24  
    25  	}
    26  }