refactor: update logger, fix warning message

This commit is contained in:
Jonas Kaninda
2024-10-23 11:59:48 +02:00
parent 4b41baed5a
commit 23edaff2c4
3 changed files with 6 additions and 6 deletions

View File

@@ -245,7 +245,7 @@ func localBackup(db *dbConfig, config *BackupConfig) {
}
fileInfo, err := os.Stat(filepath.Join(tmpPath, finalFileName))
if err != nil {
utils.Error("Error:", err)
utils.Error("Error: %s", err)
}
backupSize = fileInfo.Size()
utils.Info("Backup name is %s", finalFileName)
@@ -319,7 +319,7 @@ func s3Backup(db *dbConfig, config *BackupConfig) {
//Get backup info
fileInfo, err := os.Stat(filepath.Join(tmpPath, finalFileName))
if err != nil {
utils.Error("Error:", err)
utils.Error("Error: %s", err)
}
backupSize = fileInfo.Size()
@@ -388,7 +388,7 @@ func sshBackup(db *dbConfig, config *BackupConfig) {
//Get backup info
fileInfo, err := os.Stat(filepath.Join(tmpPath, finalFileName))
if err != nil {
utils.Error("Error:", err)
utils.Error("Error: %s", err)
}
backupSize = fileInfo.Size()
utils.Info("Backup saved in %s", filepath.Join(config.remotePath, finalFileName))
@@ -455,7 +455,7 @@ func ftpBackup(db *dbConfig, config *BackupConfig) {
//Get backup info
fileInfo, err := os.Stat(filepath.Join(tmpPath, finalFileName))
if err != nil {
utils.Error("Error:", err)
utils.Error("Error: %s", err)
}
backupSize = fileInfo.Size()
//Delete backup file from tmp folder

View File

@@ -101,7 +101,7 @@ func restoreFromRemote(db *dbConfig, conf *RestoreConfig) {
}
err = sshStorage.CopyFrom(conf.file)
if err != nil {
utils.Fatal("Error copying backup file: %w", err)
utils.Fatal("Error copying backup file: %s", err)
}
RestoreDatabase(db, conf)
}

View File

@@ -203,7 +203,7 @@ func CronNextTime(cronExpr string) time.Time {
// Parse the cron expression
schedule, err := cron.ParseStandard(cronExpr)
if err != nil {
Error("Error parsing cron expression:", err)
Error("Error parsing cron expression: %s", err)
return time.Time{}
}
// Get the current time