hide password parameter
@@ -170,12 +170,24 @@ func getSASLConfiguration(opts url.Values) (string, string, bool, error) {
return user, password, true, nil
}
+// usageKafkaclient return sink options with *** for password option.
+func usageKafkaclient(values url.Values) string {
+ var password []string
+ if len(values["password"]) != 0 {
+ password = values["password"]
+ values["password"] = []string{"***"}
+ defer func() { values["password"] = password }()
+ }
+ options := fmt.Sprintf("kafka sink option: %v", values)
+ return options
+}
+
func NewKafkaClient(uri *url.URL, topicType string) (KafkaClient, error) {
opts, err := url.ParseQuery(uri.RawQuery)
if err != nil {
return nil, fmt.Errorf("failed to parse url's query string: %s", err)
}
- glog.V(6).Infof("kafka sink option: %v", opts)
+ glog.V(3).Info(usageKafkaclient(opts))
topic, err := getTopic(opts, topicType)
if err != nil {
