Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean McCullough committed Sep 16, 2015
1 parent 02210dd commit 138485c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion collector/cmd/collector/main.go
Expand Up @@ -38,7 +38,7 @@ func main() {
writer := collector.NewCollectdWriter(*h, os.Stdout)

collector := collector.NewCollector(client, writer, *i)

log.Println("Starting")
err = collector.Run(5)
if err != nil {
log.Fatal(err)
Expand Down
2 changes: 2 additions & 0 deletions collector/collector.go
Expand Up @@ -55,6 +55,7 @@ func (c *Collector) Run(interval int) error {
}

for _, container := range containers {
log.Printf("starting collector for container %s\n", container.ID)
go c.handle(container.ID)
}

Expand All @@ -70,6 +71,7 @@ func (c *Collector) Run(interval int) error {

func (c *Collector) handle(id string) {
m, err := NewMonitor(c.client, id, c.interval)
log.Println("Error? %e", err)
if err != nil {
if err == ErrNoNeedToMonitor {
return
Expand Down
2 changes: 2 additions & 0 deletions collector/monitor.go
Expand Up @@ -2,6 +2,7 @@ package collector

import (
"errors"
"log"
"strings"

"github.com/fsouza/go-dockerclient"
Expand Down Expand Up @@ -79,6 +80,7 @@ func (m *Monitor) handle(ch chan<- Stats) error {
Stats: *s,
}

log.Println("Polling for %s %s", m.app, m.task)
i++
}
}()
Expand Down

0 comments on commit 138485c

Please sign in to comment.