From d8110a57bf7c6227e25a71b45c38b2370fd01815 Mon Sep 17 00:00:00 2001
From: Link Dupont
Date: Wed, 3 Apr 2024 10:07:24 -0400
Subject: [PATCH] feat(worker): Add debug logging to startWorker
Add more debug logging to the startWorker and loadWorkerConfig
functions.
Signed-off-by: Link Dupont
---
cmd/yggd/worker.go | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cmd/yggd/worker.go b/cmd/yggd/worker.go
index 3a5c2d11..e870eceb 100644
--- a/cmd/yggd/worker.go
+++ b/cmd/yggd/worker.go
@@ -47,6 +47,7 @@ func loadWorkerConfig(file string) (*workerConfig, error) {
if err := toml.Unmarshal(data, &config); err != nil {
return nil, fmt.Errorf("cannot load config: %w", err)
}
+ log.Debugf("loaded worker config: %v", config)
return &config, nil
}
@@ -98,6 +99,7 @@ func startWorker(config workerConfig, started workerStartedFunc, stopped workerS
time.Sleep(config.delay)
}
+ log.Debugf("starting worker %v with environment: %v", config.program, env)
err := startProcess(config.program, nil, env, func(pid int, stdout, stderr io.ReadCloser) {
log.Infof("started worker: %v", config.program)