Make logs follow a more consistent format

This commit is contained in:
Matthew Penner 2020-12-27 13:01:34 -07:00
parent 640e30de8a
commit de4d2f4724
4 changed files with 10 additions and 10 deletions

View File

@ -375,7 +375,7 @@ func postTransfer(c *gin.Context) {
}
sendTransferLog("Writing archive to disk...")
data.log().Info("writing transfer archive to disk..")
data.log().Info("writing transfer archive to disk...")
// Copy the file.
progress := &downloadProgress{size: size}

View File

@ -123,7 +123,7 @@ func (b *Backup) Details() *ArchiveDetails {
go func() {
defer wg.Done()
l.Info("computing checksum for backup..")
l.Info("computing checksum for backup...")
resp, err := b.Checksum()
if err != nil {
log.WithFields(log.Fields{

View File

@ -53,11 +53,11 @@ func (b *LocalBackup) Generate(basePath, ignore string) (*ArchiveDetails, error)
"adapter": "local",
})
l.Info("attempting to create backup..")
l.Info("creating backup for server...")
if err := a.Create(b.Path()); err != nil {
return nil, err
}
l.Info("created backup successfully.")
l.Info("created backup successfully")
return b.Details(), nil
}

View File

@ -32,11 +32,11 @@ func (s *S3Backup) Generate(basePath, ignore string) (*ArchiveDetails, error) {
"adapter": "s3",
})
l.Info("attempting to create backup..")
l.Info("creating backup for server...")
if err := a.Create(s.Path()); err != nil {
return nil, err
}
l.Info("created backup successfully.")
l.Info("created backup successfully")
rc, err := os.Open(s.Path())
if err != nil {
@ -75,21 +75,21 @@ func (s *S3Backup) generateRemoteRequest(rc io.ReadCloser) error {
"adapter": "s3",
})
l.Debug("attempting to get size of backup..")
l.Debug("attempting to get size of backup...")
size, err := s.Backup.Size()
if err != nil {
return err
}
l.WithField("size", size).Debug("got size of backup")
l.Debug("attempting to get S3 upload urls from Panel..")
l.Debug("attempting to get S3 upload urls from Panel...")
urls, err := api.New().GetBackupRemoteUploadURLs(s.Backup.Uuid, size)
if err != nil {
return err
}
l.Debug("got S3 upload urls from the Panel")
partCount := len(urls.Parts)
l.WithField("parts", partCount).Info("attempting to upload backup..")
l.WithField("parts", partCount).Info("attempting to upload backup...")
handlePart := func(part string, size int64) (string, error) {
r, err := http.NewRequest(http.MethodPut, part, nil)
@ -139,7 +139,7 @@ func (s *S3Backup) generateRemoteRequest(rc io.ReadCloser) error {
return err
}
l.WithField("part_id", part).Info("successfully uploaded backup part.")
l.WithField("part_id", part).Info("successfully uploaded backup part")
}
l.WithField("parts", partCount).Info("backup has been successfully uploaded")