Replaced ad-hoc printf with log levels
This commit is contained in:
1 parent
d3d07deec6
commit
337919d741
6 files changed
+38
-35
No files matched your search
+3
-4
@@ -2,19 +2,18 @@ package weavedns
|
||||
|
||||
import (
|
||||
"github.com/fsouza/go-dockerclient"
|
||||
"log"
|
||||
)
|
||||
|
||||
func StartUpdater(apiPath string, zone Zone) error {
|
||||
client, err := docker.NewClient(apiPath)
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to connect to Docker API on %s: %s", apiPath, err)
|
||||
Error.Fatalf("Unable to connect to Docker API on %s: %s", apiPath, err)
|
||||
}
|
||||
|
||||
events := make(chan *docker.APIEvents)
|
||||
client.AddEventListener(events)
|
||||
|
||||
log.Printf("Using Docker API on %s", apiPath)
|
||||
Info.Printf("Using Docker API on %s", apiPath)
|
||||
|
||||
go func() {
|
||||
for event := range events {
|
||||
@@ -28,7 +27,7 @@ func handleEvent(zone Zone, event *docker.APIEvents, client *docker.Client) erro
|
||||
switch event.Status {
|
||||
case "die":
|
||||
id := event.ID
|
||||
log.Printf("Container %s down. Removing records", id)
|
||||
Info.Printf("Container %s down. Removing records", id)
|
||||
zone.DeleteRecordsFor(id)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user