Change some logs

This commit is contained in:
M. Mert Yildiran 2023-03-13 22:45:57 +03:00
parent bcc1a36d71
commit a4d35599df
No known key found for this signature in database
GPG Key ID: DA5D6DCBB758A461
4 changed files with 12 additions and 12 deletions

View File

@ -142,7 +142,7 @@ func watchScripts(block bool) {
log.Error().Err(err).Send() log.Error().Err(err).Send()
} }
log.Info().Str("directory", config.Config.Scripting.Source).Msg("Watching files against changes:") log.Info().Str("directory", config.Config.Scripting.Source).Msg("Watching scripts against changes:")
if block { if block {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())

View File

@ -433,7 +433,7 @@ func postHubStarted(ctx context.Context, kubernetesProvider *kubernetes.Provider
} }
// Grace period // Grace period
log.Info().Msg("Please wait...") log.Info().Msg("Waiting for worker containers...")
time.Sleep(5 * time.Second) time.Sleep(5 * time.Second)
} }

View File

@ -39,7 +39,7 @@ func (config *ScriptingConfig) GetScripts() (scripts []*misc.Script, err error)
} }
scripts = append(scripts, script) scripts = append(scripts, script)
log.Info().Str("path", path).Msg("Found script:") log.Debug().Str("path", path).Msg("Found script:")
} }
return return

View File

@ -79,7 +79,7 @@ func (connector *Connector) PostWorkerPodToHub(pod *v1.Pod) {
} }
log.Warn().Err(err).Msg("Failed sending the Worker pod to Hub. Retrying...") log.Warn().Err(err).Msg("Failed sending the Worker pod to Hub. Retrying...")
} else { } else {
log.Info().Interface("worker-pod", pod).Msg("Reported worker pod to Hub:") log.Debug().Interface("worker-pod", pod).Msg("Reported worker pod to Hub:")
return return
} }
time.Sleep(DefaultSleep) time.Sleep(DefaultSleep)
@ -109,7 +109,7 @@ func (connector *Connector) PostStorageLimitToHub(limit int64) {
} }
log.Warn().Err(err).Msg("Failed sending the storage limit to Hub. Retrying...") log.Warn().Err(err).Msg("Failed sending the storage limit to Hub. Retrying...")
} else { } else {
log.Info().Int("limit", int(limit)).Msg("Reported storage limit to Hub:") log.Debug().Int("limit", int(limit)).Msg("Reported storage limit to Hub:")
return return
} }
time.Sleep(DefaultSleep) time.Sleep(DefaultSleep)
@ -142,7 +142,7 @@ func (connector *Connector) PostRegexToHub(regex string, namespaces []string) {
} }
log.Warn().Err(err).Msg("Failed sending the pod regex to Hub. Retrying...") log.Warn().Err(err).Msg("Failed sending the pod regex to Hub. Retrying...")
} else { } else {
log.Info().Str("regex", regex).Strs("namespaces", namespaces).Msg("Reported pod regex to Hub:") log.Debug().Str("regex", regex).Strs("namespaces", namespaces).Msg("Reported pod regex to Hub:")
return return
} }
time.Sleep(DefaultSleep) time.Sleep(DefaultSleep)
@ -173,7 +173,7 @@ func (connector *Connector) PostLicense(license string) {
} }
log.Warn().Err(err).Msg("Failed sending the license to Hub. Retrying...") log.Warn().Err(err).Msg("Failed sending the license to Hub. Retrying...")
} else { } else {
log.Info().Str("license", license).Msg("Reported license to Hub:") log.Debug().Str("license", license).Msg("Reported license to Hub:")
return return
} }
time.Sleep(DefaultSleep) time.Sleep(DefaultSleep)
@ -200,7 +200,7 @@ func (connector *Connector) PostEnv(env map[string]interface{}) {
} }
log.Warn().Err(err).Msg("Failed sending the scripting environment variables to Hub. Retrying...") log.Warn().Err(err).Msg("Failed sending the scripting environment variables to Hub. Retrying...")
} else { } else {
log.Info().Interface("env", env).Msg("Reported scripting environment variables to Hub:") log.Debug().Interface("env", env).Msg("Reported scripting environment variables to Hub:")
return return
} }
time.Sleep(DefaultSleep) time.Sleep(DefaultSleep)
@ -239,7 +239,7 @@ func (connector *Connector) PostScript(script *misc.Script) (index int64, err er
index = int64(val.(float64)) index = int64(val.(float64))
log.Info().Int("index", int(index)).Interface("script", script).Msg("Created script on Hub:") log.Debug().Int("index", int(index)).Interface("script", script).Msg("Created script on Hub:")
return return
} }
time.Sleep(DefaultSleep) time.Sleep(DefaultSleep)
@ -281,7 +281,7 @@ func (connector *Connector) PutScript(script *misc.Script, index int64) (err err
} }
log.Warn().Err(err).Msg("Failed updating script on Hub:") log.Warn().Err(err).Msg("Failed updating script on Hub:")
} else { } else {
log.Info().Int("index", int(index)).Interface("script", script).Msg("Updated script on Hub:") log.Debug().Int("index", int(index)).Interface("script", script).Msg("Updated script on Hub:")
return return
} }
time.Sleep(DefaultSleep) time.Sleep(DefaultSleep)
@ -319,7 +319,7 @@ func (connector *Connector) DeleteScript(index int64) (err error) {
} }
log.Warn().Err(err).Msg("Failed deleting script on Hub:") log.Warn().Err(err).Msg("Failed deleting script on Hub:")
} else { } else {
log.Info().Int("index", int(index)).Msg("Deleted script on Hub:") log.Debug().Int("index", int(index)).Msg("Deleted script on Hub:")
return return
} }
time.Sleep(DefaultSleep) time.Sleep(DefaultSleep)
@ -341,7 +341,7 @@ func (connector *Connector) PostScriptDone() {
} }
log.Warn().Err(err).Msg("Failed sending the POST scripts done to Hub. Retrying...") log.Warn().Err(err).Msg("Failed sending the POST scripts done to Hub. Retrying...")
} else { } else {
log.Info().Msg("Reported POST scripts done to Hub.") log.Debug().Msg("Reported POST scripts done to Hub.")
return return
} }
time.Sleep(DefaultSleep) time.Sleep(DefaultSleep)