mirror of
https://github.com/pgsty/minio.git
synced 2026-07-23 22:16:15 +03:00
Modify fatalIf, startup and update message logging code (#5780)
Use a common logging framework to log fatalIf, startup, Info and Update messages.
This commit is contained in:
+23
-23
@@ -30,7 +30,7 @@ import (
|
||||
)
|
||||
|
||||
// DO NOT EDIT following message template, please open a github issue to discuss instead.
|
||||
var configMigrateMSGTemplate = "Configuration file %s migrated from version '%s' to '%s' successfully.\n"
|
||||
var configMigrateMSGTemplate = "Configuration file %s migrated from version '%s' to '%s' successfully."
|
||||
|
||||
// Migrates all config versions from "1" to "18".
|
||||
func migrateConfig() error {
|
||||
@@ -195,7 +195,7 @@ func purgeV1() error {
|
||||
}
|
||||
|
||||
os.RemoveAll(configFile)
|
||||
logger.Println("Removed unsupported config version ‘1’.")
|
||||
logger.Info("Removed unsupported config version ‘1’.")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ func migrateV2ToV3() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv2.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv2.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv2.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ func migrateV3ToV4() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv3.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv3.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv3.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ func migrateV4ToV5() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv4.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv4.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv4.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -421,7 +421,7 @@ func migrateV5ToV6() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv5.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv5.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv5.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ func migrateV6ToV7() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv6.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv6.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv6.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ func migrateV7ToV8() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv7.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv7.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv7.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -610,7 +610,7 @@ func migrateV8ToV9() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv8.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv8.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv8.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -678,7 +678,7 @@ func migrateV9ToV10() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv9.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv9.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv9.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -749,7 +749,7 @@ func migrateV10ToV11() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv10.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv10.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv10.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -847,7 +847,7 @@ func migrateV11ToV12() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv11.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv11.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv11.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -927,7 +927,7 @@ func migrateV12ToV13() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv12.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv12.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv12.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1012,7 +1012,7 @@ func migrateV13ToV14() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv13.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv13.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv13.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1101,7 +1101,7 @@ func migrateV14ToV15() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv14.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv14.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv14.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1191,7 +1191,7 @@ func migrateV15ToV16() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv15.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv15.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv15.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1312,7 +1312,7 @@ func migrateV16ToV17() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv16.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv16.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv16.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1416,7 +1416,7 @@ func migrateV17ToV18() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv17.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv17.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv17.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1522,7 +1522,7 @@ func migrateV18ToV19() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv18.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv18.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv18.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1627,7 +1627,7 @@ func migrateV19ToV20() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv19.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv19.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv19.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1731,7 +1731,7 @@ func migrateV20ToV21() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv20.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv20.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv20.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1835,7 +1835,7 @@ func migrateV21ToV22() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv21.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv21.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv21.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1948,6 +1948,6 @@ func migrateV22ToV23() error {
|
||||
return fmt.Errorf("Failed to migrate config from ‘%s’ to ‘%s’. %v", cv22.Version, srvConfig.Version, err)
|
||||
}
|
||||
|
||||
logger.Printf(configMigrateMSGTemplate, configFile, cv22.Version, srvConfig.Version)
|
||||
logger.Info(configMigrateMSGTemplate, configFile, cv22.Version, srvConfig.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user