aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer_replication.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command/filer_replication.go')
-rw-r--r--weed/command/filer_replication.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/weed/command/filer_replication.go b/weed/command/filer_replication.go
index 40f2b570b..1b154270e 100644
--- a/weed/command/filer_replication.go
+++ b/weed/command/filer_replication.go
@@ -4,7 +4,7 @@ import (
"context"
"strings"
- "github.com/chrislusf/seaweedfs/weed/glog"
+ "github.com/chrislusf/seaweedfs/weed/util/log"
"github.com/chrislusf/seaweedfs/weed/replication"
"github.com/chrislusf/seaweedfs/weed/replication/sink"
_ "github.com/chrislusf/seaweedfs/weed/replication/sink/azuresink"
@@ -48,10 +48,10 @@ func runFilerReplicate(cmd *Command, args []string) bool {
for _, input := range sub.NotificationInputs {
if config.GetBool("notification." + input.GetName() + ".enabled") {
if err := input.Initialize(config, "notification."+input.GetName()+"."); err != nil {
- glog.Fatalf("Failed to initialize notification input for %s: %+v",
+ log.Fatalf("Failed to initialize notification input for %s: %+v",
input.GetName(), err)
}
- glog.V(0).Infof("Configure notification input to %s", input.GetName())
+ log.Infof("Configure notification input to %s", input.GetName())
notificationInput = input
break
}
@@ -69,7 +69,7 @@ func runFilerReplicate(cmd *Command, args []string) bool {
fromDir := config.GetString("source.filer.directory")
toDir := config.GetString("sink.filer.directory")
if strings.HasPrefix(toDir, fromDir) {
- glog.Fatalf("recursive replication! source directory %s includes the sink directory %s", fromDir, toDir)
+ log.Fatalf("recursive replication! source directory %s includes the sink directory %s", fromDir, toDir)
}
}
}
@@ -78,10 +78,10 @@ func runFilerReplicate(cmd *Command, args []string) bool {
for _, sk := range sink.Sinks {
if config.GetBool("sink." + sk.GetName() + ".enabled") {
if err := sk.Initialize(config, "sink."+sk.GetName()+"."); err != nil {
- glog.Fatalf("Failed to initialize sink for %s: %+v",
+ log.Fatalf("Failed to initialize sink for %s: %+v",
sk.GetName(), err)
}
- glog.V(0).Infof("Configure sink to %s", sk.GetName())
+ log.Infof("Configure sink to %s", sk.GetName())
dataSink = sk
break
}
@@ -100,7 +100,7 @@ func runFilerReplicate(cmd *Command, args []string) bool {
for {
key, m, err := notificationInput.ReceiveMessage()
if err != nil {
- glog.Errorf("receive %s: %+v", key, err)
+ log.Errorf("receive %s: %+v", key, err)
continue
}
if key == "" {
@@ -108,16 +108,16 @@ func runFilerReplicate(cmd *Command, args []string) bool {
continue
}
if m.OldEntry != nil && m.NewEntry == nil {
- glog.V(1).Infof("delete: %s", key)
+ log.Debugf("delete: %s", key)
} else if m.OldEntry == nil && m.NewEntry != nil {
- glog.V(1).Infof(" add: %s", key)
+ log.Debugf(" add: %s", key)
} else {
- glog.V(1).Infof("modify: %s", key)
+ log.Debugf("modify: %s", key)
}
if err = replicator.Replicate(context.Background(), key, m); err != nil {
- glog.Errorf("replicate %s: %+v", key, err)
+ log.Errorf("replicate %s: %+v", key, err)
} else {
- glog.V(1).Infof("replicated %s", key)
+ log.Debugf("replicated %s", key)
}
}
@@ -130,7 +130,7 @@ func validateOneEnabledInput(config *viper.Viper) {
if enabledInput == "" {
enabledInput = input.GetName()
} else {
- glog.Fatalf("Notification input is enabled for both %s and %s", enabledInput, input.GetName())
+ log.Fatalf("Notification input is enabled for both %s and %s", enabledInput, input.GetName())
}
}
}