restructured the different package, cleaned some non used code, added comments, still have to reorganize packages to optimize packages
This commit is contained in:
		| @@ -1,4 +1,4 @@ | ||||
| package models | ||||
| package logger | ||||
| 
 | ||||
| import ( | ||||
| 	"bufio" | ||||
| @@ -6,6 +6,7 @@ import ( | ||||
| 	"fmt" | ||||
| 	"io" | ||||
| 	"oc-monitord/conf" | ||||
| 
 | ||||
| 	"strings" | ||||
| 	"sync" | ||||
| 
 | ||||
| @@ -106,7 +107,7 @@ func LogLocalWorkflow(wfName string, pipe io.ReadCloser, wg *sync.WaitGroup) { | ||||
| } | ||||
| 
 | ||||
| // Debug, no logs sent | ||||
| func LogPods(wfName string, pipe io.ReadCloser, steps []string, wg *sync.WaitGroup) { | ||||
| func LogLocalPod(wfName string, pipe io.ReadCloser, steps []string, wg *sync.WaitGroup) { | ||||
| 	scanner := bufio.NewScanner(pipe) | ||||
| 	for scanner.Scan() { | ||||
| 		var podLogger zerolog.Logger | ||||
| @@ -118,6 +119,7 @@ func LogPods(wfName string, pipe io.ReadCloser, steps []string, wg *sync.WaitGro | ||||
| 		podLogger = wfLogger.With().Str("step_name", getStepName(podName, steps)).Logger() | ||||
| 		log := strings.Split(line,podName+":")[1] | ||||
| 		podLog := NewArgoPodLog(wfName,podName,log) | ||||
| 		 | ||||
| 		jsonifiedLog, err := json.Marshal(podLog) | ||||
| 		if err != nil { | ||||
| 			podLogger.Fatal().Msg(err.Error()) | ||||
		Reference in New Issue
	
	Block a user