Make logs follow a more consistent format
This commit is contained in:
parent
640e30de8a
commit
de4d2f4724
|
@ -375,7 +375,7 @@ func postTransfer(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
sendTransferLog("Writing archive to disk...")
|
sendTransferLog("Writing archive to disk...")
|
||||||
data.log().Info("writing transfer archive to disk..")
|
data.log().Info("writing transfer archive to disk...")
|
||||||
|
|
||||||
// Copy the file.
|
// Copy the file.
|
||||||
progress := &downloadProgress{size: size}
|
progress := &downloadProgress{size: size}
|
||||||
|
|
|
@ -123,7 +123,7 @@ func (b *Backup) Details() *ArchiveDetails {
|
||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
|
||||||
l.Info("computing checksum for backup..")
|
l.Info("computing checksum for backup...")
|
||||||
resp, err := b.Checksum()
|
resp, err := b.Checksum()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
|
|
|
@ -53,11 +53,11 @@ func (b *LocalBackup) Generate(basePath, ignore string) (*ArchiveDetails, error)
|
||||||
"adapter": "local",
|
"adapter": "local",
|
||||||
})
|
})
|
||||||
|
|
||||||
l.Info("attempting to create backup..")
|
l.Info("creating backup for server...")
|
||||||
if err := a.Create(b.Path()); err != nil {
|
if err := a.Create(b.Path()); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
l.Info("created backup successfully.")
|
l.Info("created backup successfully")
|
||||||
|
|
||||||
return b.Details(), nil
|
return b.Details(), nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,11 +32,11 @@ func (s *S3Backup) Generate(basePath, ignore string) (*ArchiveDetails, error) {
|
||||||
"adapter": "s3",
|
"adapter": "s3",
|
||||||
})
|
})
|
||||||
|
|
||||||
l.Info("attempting to create backup..")
|
l.Info("creating backup for server...")
|
||||||
if err := a.Create(s.Path()); err != nil {
|
if err := a.Create(s.Path()); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
l.Info("created backup successfully.")
|
l.Info("created backup successfully")
|
||||||
|
|
||||||
rc, err := os.Open(s.Path())
|
rc, err := os.Open(s.Path())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -75,21 +75,21 @@ func (s *S3Backup) generateRemoteRequest(rc io.ReadCloser) error {
|
||||||
"adapter": "s3",
|
"adapter": "s3",
|
||||||
})
|
})
|
||||||
|
|
||||||
l.Debug("attempting to get size of backup..")
|
l.Debug("attempting to get size of backup...")
|
||||||
size, err := s.Backup.Size()
|
size, err := s.Backup.Size()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
l.WithField("size", size).Debug("got size of backup")
|
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)
|
urls, err := api.New().GetBackupRemoteUploadURLs(s.Backup.Uuid, size)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
l.Debug("got S3 upload urls from the Panel")
|
l.Debug("got S3 upload urls from the Panel")
|
||||||
partCount := len(urls.Parts)
|
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) {
|
handlePart := func(part string, size int64) (string, error) {
|
||||||
r, err := http.NewRequest(http.MethodPut, part, nil)
|
r, err := http.NewRequest(http.MethodPut, part, nil)
|
||||||
|
@ -139,7 +139,7 @@ func (s *S3Backup) generateRemoteRequest(rc io.ReadCloser) error {
|
||||||
return err
|
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")
|
l.WithField("parts", partCount).Info("backup has been successfully uploaded")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user