mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Create logger package and rename errorIf to LogIf (#5678)
Removing message from error logging Replace errors.Trace with LogIf
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/minio/minio/cmd/logger"
|
||||
"github.com/minio/minio/pkg/auth"
|
||||
"github.com/minio/minio/pkg/event"
|
||||
"github.com/minio/minio/pkg/event/target"
|
||||
@@ -194,7 +195,7 @@ func purgeV1() error {
|
||||
}
|
||||
|
||||
os.RemoveAll(configFile)
|
||||
log.Println("Removed unsupported config version ‘1’.")
|
||||
logger.Println("Removed unsupported config version ‘1’.")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -252,7 +253,7 @@ func migrateV2ToV3() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv2.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv2.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv2.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -290,7 +291,7 @@ func migrateV3ToV4() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv3.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv3.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv3.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -331,7 +332,7 @@ func migrateV4ToV5() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv4.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv4.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv4.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -420,7 +421,7 @@ func migrateV5ToV6() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv5.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv5.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv5.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -476,7 +477,7 @@ func migrateV6ToV7() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv6.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv6.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv6.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -539,7 +540,7 @@ func migrateV7ToV8() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv7.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv7.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv7.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -609,7 +610,7 @@ func migrateV8ToV9() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv8.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv8.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv8.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -677,7 +678,7 @@ func migrateV9ToV10() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv9.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv9.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv9.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -748,7 +749,7 @@ func migrateV10ToV11() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv10.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv10.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv10.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -846,7 +847,7 @@ func migrateV11ToV12() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv11.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv11.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv11.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -926,7 +927,7 @@ func migrateV12ToV13() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv12.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv12.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv12.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1011,7 +1012,7 @@ func migrateV13ToV14() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv13.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv13.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv13.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1100,7 +1101,7 @@ func migrateV14ToV15() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv14.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv14.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv14.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1190,7 +1191,7 @@ func migrateV15ToV16() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv15.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv15.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv15.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1311,7 +1312,7 @@ func migrateV16ToV17() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv16.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv16.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv16.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1415,7 +1416,7 @@ func migrateV17ToV18() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv17.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv17.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv17.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1521,7 +1522,7 @@ func migrateV18ToV19() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv18.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv18.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv18.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1626,7 +1627,7 @@ func migrateV19ToV20() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv19.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv19.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv19.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1730,7 +1731,7 @@ func migrateV20ToV21() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv20.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv20.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv20.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1834,7 +1835,7 @@ func migrateV21ToV22() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv21.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv21.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv21.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1947,6 +1948,6 @@ func migrateV22ToV23() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv22.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
log.Printf(configMigrateMSGTemplate, configFile, cv22.Version, srvConfig.Version)
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv22.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user