summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-10 14:38:50 +0300
committerWolfy-J <[email protected]>2018-06-10 14:38:50 +0300
commit025887da77e15cd5e80d4182bf7095dac6cab12c (patch)
treea8188a5dc3d7118acc803cd71d07bb69ac81abb2
parentde138fe87ac3e1dafcd6dcedaa14ca53a4dac511 (diff)
more verbosity
-rw-r--r--service/container.go3
-rw-r--r--service/container_test.go2
2 files changed, 5 insertions, 0 deletions
diff --git a/service/container.go b/service/container.go
index 88d9ef41..bf712092 100644
--- a/service/container.go
+++ b/service/container.go
@@ -151,11 +151,13 @@ func (c *container) Serve() error {
continue
}
+ c.log.Debugf("%s.service: started", e.name)
go func(e *entry) {
e.setStatus(StatusServing)
defer e.setStatus(StatusStopped)
if err := e.svc.Serve(); err != nil {
+ c.log.Errorf("%s.service: %s", e.name, err)
done <- errors.Wrap(err, fmt.Sprintf("%s.service", e.name))
}
}(e)
@@ -184,6 +186,7 @@ func (c *container) Stop() {
if e.hasStatus(StatusServing) {
e.svc.Stop()
e.setStatus(StatusStopped)
+ c.log.Debugf("%s.service: stopped", e.name)
}
}
}
diff --git a/service/container_test.go b/service/container_test.go
index 69d67441..5278efe7 100644
--- a/service/container_test.go
+++ b/service/container_test.go
@@ -309,4 +309,6 @@ func TestContainer_ServeErrorMultiple(t *testing.T) {
s, st = c.Get("test2")
assert.IsType(t, &testService{}, s)
assert.Equal(t, StatusStopped, st)
+
+ assert.Equal(t, 6, len(hook.Entries))
}