Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Jul 16, 2024
1 parent 84936ed commit b93ed09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions service/mgr/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (g *Group) Start() error {
m.mgr.Info("starting")
startTime := time.Now()

err := m.mgr.Do(m.mgr.name+" Start", func(_ *WorkerCtx) error {
err := m.mgr.Do("start module "+m.mgr.name, func(_ *WorkerCtx) error {
return m.module.Start()
})
if err != nil {
Expand All @@ -116,7 +116,7 @@ func (g *Group) Start() error {
return fmt.Errorf("failed to start %s: %w", makeModuleName(m.module), err)
}
duration := time.Since(startTime)
m.mgr.Info("started " + duration.String())
m.mgr.Info("started", "time", duration.String())
}
g.state.Store(groupStateRunning)
return nil
Expand All @@ -142,7 +142,7 @@ func (g *Group) stopFrom(index int) (ok bool) {
for i := index; i >= 0; i-- {
m := g.modules[i]

err := m.mgr.Do(m.mgr.name+" Stop", func(_ *WorkerCtx) error {
err := m.mgr.Do("stop module "+m.mgr.name, func(_ *WorkerCtx) error {
return m.module.Stop()
})
if err != nil {
Expand Down

0 comments on commit b93ed09

Please sign in to comment.