treewide: 避免使用fmt.Print记录日志

This commit is contained in:
Yousong Zhou
2019-11-18 06:10:34 +00:00
parent 24228807c5
commit 212462cbea
3 changed files with 6 additions and 13 deletions
+4 -10
View File
@@ -16,8 +16,6 @@ package app
import (
"context"
"fmt"
"os"
"time"
"yunion.io/x/log"
@@ -33,23 +31,19 @@ import (
func InitAuth(options *common_options.CommonOptions, authComplete auth.AuthCompletedCallback) {
if len(options.AuthURL) == 0 {
fmt.Println("Missing AuthURL")
os.Exit(1)
log.Fatalln("Missing AuthURL")
}
if len(options.AdminUser) == 0 {
fmt.Println("Mising AdminUser")
os.Exit(1)
log.Fatalln("Mising AdminUser")
}
if len(options.AdminPassword) == 0 {
fmt.Println("Missing AdminPasswd")
os.Exit(1)
log.Fatalln("Missing AdminPasswd")
}
if len(options.AdminProject) == 0 {
fmt.Println("Missing AdminProject")
os.Exit(1)
log.Fatalln("Missing AdminProject")
}
a := auth.NewAuthInfo(
+2 -2
View File
@@ -77,7 +77,7 @@ func CheckSync(autoSync bool) bool {
}
} else {
for _, sql := range dropFKSqls {
fmt.Println(sql)
log.Infof("%s;", sql)
}
inSync = false
}
@@ -96,7 +96,7 @@ func CheckSync(autoSync bool) bool {
}
} else {
for _, sql := range sqls {
fmt.Println(sql)
log.Infof("%s;", sql)
}
inSync = false
}
@@ -163,7 +163,6 @@ func lbGetBackendGroupCheckStatus(ctx context.Context, userCred mcclient.TokenCr
if !ok {
continue
}
fmt.Printf("idx: %d\n", i)
backendJson := backendJsons[i].(*jsonutils.JSONDict)
for j, colName := range resSeries.Columns {
colVal := resColumns[j]