diff options
Diffstat (limited to 'weed/notification')
| -rw-r--r-- | weed/notification/aws_sqs/aws_sqs_pub.go | 6 | ||||
| -rw-r--r-- | weed/notification/configuration.go | 8 | ||||
| -rw-r--r-- | weed/notification/gocdk_pub_sub/gocdk_pub_sub.go | 10 | ||||
| -rw-r--r-- | weed/notification/google_pub_sub/google_pub_sub.go | 14 | ||||
| -rw-r--r-- | weed/notification/kafka/kafka_queue.go | 10 | ||||
| -rw-r--r-- | weed/notification/log/log_queue.go | 4 |
6 files changed, 26 insertions, 26 deletions
diff --git a/weed/notification/aws_sqs/aws_sqs_pub.go b/weed/notification/aws_sqs/aws_sqs_pub.go index c9e674257..45e21a6ec 100644 --- a/weed/notification/aws_sqs/aws_sqs_pub.go +++ b/weed/notification/aws_sqs/aws_sqs_pub.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/sqs" - "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/util/log" "github.com/seaweedfs/seaweedfs/weed/notification" "github.com/seaweedfs/seaweedfs/weed/util" "google.golang.org/protobuf/proto" @@ -28,8 +28,8 @@ func (k *AwsSqsPub) GetName() string { } func (k *AwsSqsPub) Initialize(configuration util.Configuration, prefix string) (err error) { - glog.V(0).Infof("filer.notification.aws_sqs.region: %v", configuration.GetString(prefix+"region")) - glog.V(0).Infof("filer.notification.aws_sqs.sqs_queue_name: %v", configuration.GetString(prefix+"sqs_queue_name")) + log.V(3).Infof("filer.notification.aws_sqs.region: %v", configuration.GetString(prefix+"region")) + log.V(3).Infof("filer.notification.aws_sqs.sqs_queue_name: %v", configuration.GetString(prefix+"sqs_queue_name")) return k.initialize( configuration.GetString(prefix+"aws_access_key_id"), configuration.GetString(prefix+"aws_secret_access_key"), diff --git a/weed/notification/configuration.go b/weed/notification/configuration.go index 1c620f2e6..7248c3259 100644 --- a/weed/notification/configuration.go +++ b/weed/notification/configuration.go @@ -1,7 +1,7 @@ package notification import ( - "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/util/log" "github.com/seaweedfs/seaweedfs/weed/util" "google.golang.org/protobuf/proto" ) @@ -31,11 +31,11 @@ func LoadConfiguration(config *util.ViperProxy, prefix string) { for _, queue := range MessageQueues { if config.GetBool(prefix + queue.GetName() + ".enabled") { if err := queue.Initialize(config, prefix+queue.GetName()+"."); err != nil { - glog.Fatalf("Failed to initialize notification for %s: %+v", + log.Fatalf("Failed to initialize notification for %s: %+v", queue.GetName(), err) } Queue = queue - glog.V(0).Infof("Configure notification message queue for %s", queue.GetName()) + log.V(3).Infof("Configure notification message queue for %s", queue.GetName()) return } } @@ -49,7 +49,7 @@ func validateOneEnabledQueue(config *util.ViperProxy) { if enabledQueue == "" { enabledQueue = queue.GetName() } else { - glog.Fatalf("Notification message queue is enabled for both %s and %s", enabledQueue, queue.GetName()) + log.Fatalf("Notification message queue is enabled for both %s and %s", enabledQueue, queue.GetName()) } } } diff --git a/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go b/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go index 131345f9c..1d1955234 100644 --- a/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go +++ b/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go @@ -30,7 +30,7 @@ import ( "sync" "time" - "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/util/log" "github.com/seaweedfs/seaweedfs/weed/notification" "github.com/seaweedfs/seaweedfs/weed/util" // _ "gocloud.dev/pubsub/azuresb" @@ -78,13 +78,13 @@ func (k *GoCDKPubSub) doReconnect() { k.topic.Shutdown(context.Background()) k.topicLock.RUnlock() for { - glog.Info("Try reconnect") + log.Info("Try reconnect") conn, err := amqp.Dial(os.Getenv("RABBIT_SERVER_URL")) if err == nil { k.setTopic(rabbitpubsub.OpenTopic(conn, getPath(k.topicURL), nil)) break } - glog.Error(err) + log.Error(err) time.Sleep(time.Second) } }(conn) @@ -93,10 +93,10 @@ func (k *GoCDKPubSub) doReconnect() { func (k *GoCDKPubSub) Initialize(configuration util.Configuration, prefix string) error { k.topicURL = configuration.GetString(prefix + "topic_url") - glog.V(0).Infof("notification.gocdk_pub_sub.topic_url: %v", k.topicURL) + log.V(3).Infof("notification.gocdk_pub_sub.topic_url: %v", k.topicURL) topic, err := pubsub.OpenTopic(context.Background(), k.topicURL) if err != nil { - glog.Fatalf("Failed to open topic: %v", err) + log.Fatalf("Failed to open topic: %v", err) } k.setTopic(topic) return nil diff --git a/weed/notification/google_pub_sub/google_pub_sub.go b/weed/notification/google_pub_sub/google_pub_sub.go index f5593fa48..2da5c1e51 100644 --- a/weed/notification/google_pub_sub/google_pub_sub.go +++ b/weed/notification/google_pub_sub/google_pub_sub.go @@ -6,7 +6,7 @@ import ( "os" "cloud.google.com/go/pubsub" - "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/util/log" "github.com/seaweedfs/seaweedfs/weed/notification" "github.com/seaweedfs/seaweedfs/weed/util" "google.golang.org/api/option" @@ -26,8 +26,8 @@ func (k *GooglePubSub) GetName() string { } func (k *GooglePubSub) Initialize(configuration util.Configuration, prefix string) (err error) { - glog.V(0).Infof("notification.google_pub_sub.project_id: %v", configuration.GetString(prefix+"project_id")) - glog.V(0).Infof("notification.google_pub_sub.topic: %v", configuration.GetString(prefix+"topic")) + log.V(3).Infof("notification.google_pub_sub.project_id: %v", configuration.GetString(prefix+"project_id")) + log.V(3).Infof("notification.google_pub_sub.topic: %v", configuration.GetString(prefix+"topic")) return k.initialize( configuration.GetString(prefix+"google_application_credentials"), configuration.GetString(prefix+"project_id"), @@ -43,13 +43,13 @@ func (k *GooglePubSub) initialize(google_application_credentials, projectId, top var found bool google_application_credentials, found = os.LookupEnv("GOOGLE_APPLICATION_CREDENTIALS") if !found { - glog.Fatalf("need to specific GOOGLE_APPLICATION_CREDENTIALS env variable or google_application_credentials in filer.toml") + log.Fatalf("need to specific GOOGLE_APPLICATION_CREDENTIALS env variable or google_application_credentials in filer.toml") } } client, err := pubsub.NewClient(ctx, projectId, option.WithCredentialsFile(google_application_credentials)) if err != nil { - glog.Fatalf("Failed to create client: %v", err) + log.Fatalf("Failed to create client: %v", err) } k.topic = client.Topic(topicName) @@ -57,11 +57,11 @@ func (k *GooglePubSub) initialize(google_application_credentials, projectId, top if !exists { k.topic, err = client.CreateTopic(ctx, topicName) if err != nil { - glog.Fatalf("Failed to create topic %s: %v", topicName, err) + log.Fatalf("Failed to create topic %s: %v", topicName, err) } } } else { - glog.Fatalf("Failed to check topic %s: %v", topicName, err) + log.Fatalf("Failed to check topic %s: %v", topicName, err) } return nil diff --git a/weed/notification/kafka/kafka_queue.go b/weed/notification/kafka/kafka_queue.go index 64cb4eaa9..bcb8f30f8 100644 --- a/weed/notification/kafka/kafka_queue.go +++ b/weed/notification/kafka/kafka_queue.go @@ -2,7 +2,7 @@ package kafka import ( "github.com/Shopify/sarama" - "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/util/log" "github.com/seaweedfs/seaweedfs/weed/notification" "github.com/seaweedfs/seaweedfs/weed/util" "google.golang.org/protobuf/proto" @@ -22,8 +22,8 @@ func (k *KafkaQueue) GetName() string { } func (k *KafkaQueue) Initialize(configuration util.Configuration, prefix string) (err error) { - glog.V(0).Infof("filer.notification.kafka.hosts: %v\n", configuration.GetStringSlice(prefix+"hosts")) - glog.V(0).Infof("filer.notification.kafka.topic: %v\n", configuration.GetString(prefix+"topic")) + log.V(3).Infof("filer.notification.kafka.hosts: %v\n", configuration.GetStringSlice(prefix+"hosts")) + log.V(3).Infof("filer.notification.kafka.topic: %v\n", configuration.GetString(prefix+"topic")) return k.initialize( configuration.GetStringSlice(prefix+"hosts"), configuration.GetString(prefix+"topic"), @@ -67,7 +67,7 @@ func (k *KafkaQueue) handleSuccess() { for { pm := <-k.producer.Successes() if pm != nil { - glog.V(3).Infof("producer message success, partition:%d offset:%d key:%v", pm.Partition, pm.Offset, pm.Key) + log.V(0).Infof("producer message success, partition:%d offset:%d key:%v", pm.Partition, pm.Offset, pm.Key) } } } @@ -76,7 +76,7 @@ func (k *KafkaQueue) handleError() { for { err := <-k.producer.Errors() if err != nil { - glog.Errorf("producer message error, partition:%d offset:%d key:%v value:%s error(%v) topic:%s", err.Msg.Partition, err.Msg.Offset, err.Msg.Key, err.Msg.Value, err.Err, k.topic) + log.Errorf("producer message error, partition:%d offset:%d key:%v value:%s error(%v) topic:%s", err.Msg.Partition, err.Msg.Offset, err.Msg.Key, err.Msg.Value, err.Err, k.topic) } } } diff --git a/weed/notification/log/log_queue.go b/weed/notification/log/log_queue.go index cc3557fee..51fb51c0b 100644 --- a/weed/notification/log/log_queue.go +++ b/weed/notification/log/log_queue.go @@ -1,7 +1,7 @@ package kafka import ( - "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/util/log" "github.com/seaweedfs/seaweedfs/weed/notification" "github.com/seaweedfs/seaweedfs/weed/util" "google.golang.org/protobuf/proto" @@ -24,6 +24,6 @@ func (k *LogQueue) Initialize(configuration util.Configuration, prefix string) ( func (k *LogQueue) SendMessage(key string, message proto.Message) (err error) { - glog.V(0).Infof("%v: %+v", key, message) + log.V(3).Infof("%v: %+v", key, message) return nil } |
