fixed log, package

This commit is contained in:
snoop 2017-08-04 12:00:26 +09:00
parent 31086ce17d
commit 2f9be008fd

View File

@ -4,7 +4,7 @@ import (
"context"
g "git.loafle.net/overflow/overflow_probe/crawler/grpc"
"google.golang.org/grpc"
"log"
log "github.com/cihub/seelog"
"encoding/json"
"git.loafle.net/overflow/overflow_probe/agent_api/config_manager"
@ -16,7 +16,8 @@ func callAdd(container *string, conf *config_manager.Config) bool {
conn, err := grpc.Dial(address+port, grpc.WithInsecure())
if err != nil {
log.Fatalf("did not connect: %v", err)
//log.Fatalf("did not connect: %v", err)
log.Error( err)
return false
}
defer conn.Close()
@ -35,9 +36,10 @@ func callAdd(container *string, conf *config_manager.Config) bool {
out, err := cc.Add(context.Background(), in)
if err != nil {
log.Println(err)
log.Error(err)
}
log.Println("callAdd:", out)
//log.Println("callAdd:", out)
log.Debug("callAdd:", out)
return true
@ -59,7 +61,8 @@ func callInitConfig(container *string, cl []*config_manager.Config) bool {
conn, err := grpc.Dial(address+port, grpc.WithInsecure())
if err != nil {
log.Fatalf("did not connect: %v", err)
//log.Fatalf("did not connect: %v", err)
log.Error( err)
return false
}
defer conn.Close()
@ -84,10 +87,10 @@ func callInitConfig(container *string, cl []*config_manager.Config) bool {
outInit, errInit := cc.Init(context.Background(), inArr)
if errInit != nil {
log.Println(errInit)
log.Debug(errInit)
return false
}
log.Println("callInit:", outInit)
log.Debug("callInit:", outInit)
return true
@ -144,7 +147,8 @@ func callRemove(container *string, conf *config_manager.Config) {
conn, err := grpc.Dial(address+port, grpc.WithInsecure())
if err != nil {
log.Fatalf("did not connect: %v", err)
//log.Fatalf("did not connect: %v", err)
log.Error( err)
}
defer conn.Close()
@ -156,9 +160,9 @@ func callRemove(container *string, conf *config_manager.Config) {
outRem, errRem := cc.Remove(context.Background(), inR)
if errRem != nil {
log.Println(errRem)
log.Debug(errRem)
}
log.Println("callRemove:", outRem)
log.Debug("callRemove:", outRem)
}
@ -178,7 +182,7 @@ func callStatusAddress(addr string) bool {
conn, err := grpc.Dial(addr, grpc.WithInsecure())
if err != nil {
log.Fatalf("did not connect: %v", err)
log.Error("did not connect: ", err)
}
defer conn.Close()
@ -188,7 +192,7 @@ func callStatusAddress(addr string) bool {
out, err := c.Status(context.Background(), e)
if err != nil {
log.Fatalf("could not greet: %v", err)
log.Error("could not greet: ", err)
}
return out.Check