Skip to content

Commit

Permalink
feat(worker): Add debug logging to startWorker
Browse files Browse the repository at this point in the history
Add more debug logging to the startWorker and loadWorkerConfig
functions.

Signed-off-by: Link Dupont <link@sub-pop.net>
  • Loading branch information
subpop authored and jirihnidek committed Apr 16, 2024
1 parent 3a2b3d1 commit d8110a5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/yggd/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit d8110a5

Please sign in to comment.