diff --git a/huaweicloud/utils/fmtp/errors.go b/huaweicloud/utils/fmtp/errors.go new file mode 100644 index 0000000000..a9e7a50cad --- /dev/null +++ b/huaweicloud/utils/fmtp/errors.go @@ -0,0 +1,11 @@ +package fmtp + +import ( + "fmt" + "strings" +) + +func Errorf(format string, a ...interface{}) error { + newFormat := strings.Replace(format, REPLACE_STR, "", -1) + return fmt.Errorf(newFormat, a) +} diff --git a/huaweicloud/utils/fmtp/print.go b/huaweicloud/utils/fmtp/print.go new file mode 100644 index 0000000000..37f9ca5f42 --- /dev/null +++ b/huaweicloud/utils/fmtp/print.go @@ -0,0 +1,13 @@ +package fmtp + +import ( + "fmt" + "strings" +) + +const REPLACE_STR = "huawei" + +func Sprintf(format string, a ...interface{}) string { + newFormat := strings.Replace(format, REPLACE_STR, "", -1) + return fmt.Sprintf(newFormat, a) +} diff --git a/huaweicloud/utils/logp/log.go b/huaweicloud/utils/logp/log.go new file mode 100644 index 0000000000..187575964e --- /dev/null +++ b/huaweicloud/utils/logp/log.go @@ -0,0 +1,14 @@ +package logp + +import ( + "log" + "strings" +) + +const REPLACE_STR = "huawei" + +func Printf(format string, v ...interface{}) { + newFormat := strings.Replace(format, REPLACE_STR, "", -1) + log.Printf(newFormat, v) + +}