restructured the different package, cleaned some non used code, added comments, still have to reorganize packages to optimize packages

This commit is contained in:
pb 2025-04-17 16:53:36 +02:00
parent fb8d994be3
commit 5f70feab59

View File

@ -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())