moved the logger creation to the utils package to make them available to all packages without recreating or passing them
This commit is contained in:
9
main.go
9
main.go
@@ -67,7 +67,7 @@ func main() {
|
||||
conf.GetConfig().Logs,
|
||||
)
|
||||
|
||||
logger = logs.CreateLogger("oc-monitord")
|
||||
logger = u.GetLogger()
|
||||
|
||||
logger.Debug().Msg("Loki URL : " + conf.GetConfig().LokiURL)
|
||||
logger.Debug().Msg("Workflow executed : " + conf.GetConfig().ExecutionID)
|
||||
@@ -124,13 +124,16 @@ func executeInside(execID string, ns string, argo_file_path string, stepMax int)
|
||||
t, err := tools2.NewService(conf.GetConfig().Mode)
|
||||
if err != nil {
|
||||
logger.Error().Msg("Could not create KubernetesTool")
|
||||
return
|
||||
}
|
||||
|
||||
name, err := t.CreateArgoWorkflow(argo_file_path, ns)
|
||||
|
||||
if err != nil {
|
||||
logger.Error().Msg("Could not create argo workflow : " + err.Error())
|
||||
return
|
||||
} else {
|
||||
split := strings.Split(argo_file_path, "_")
|
||||
argoLogs := models.NewArgoLogs(split[0], "argo", stepMax)
|
||||
argoLogs := models.NewArgoLogs(workflowName, "argo", stepMax)
|
||||
argoLogs.StartStepRecording(argoLogs.NewWatch(), wf_logger)
|
||||
err := t.LogWorkflow(execID, ns, name, argo_file_path, stepMax, argoLogs.NewWatch(), argoLogs.NewWatch(), argoLogs, []string{}, logWorkflow)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user