Backend: Reduce YAML backup log level

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-07-17 17:38:22 +02:00
parent 63603ff778
commit 66a71d7271
2 changed files with 5 additions and 4 deletions

View file

@ -3,6 +3,7 @@ package api
import (
"fmt"
"net/http"
"path/filepath"
"github.com/gin-gonic/gin"
"github.com/photoprism/photoprism/internal/acl"
@ -28,7 +29,7 @@ func SavePhotoAsYaml(p entity.Photo) {
if err := p.SaveAsYaml(yamlFile); err != nil {
log.Errorf("photo: %s (update yaml)", err)
} else {
log.Infof("photo: updated yaml file %s", txt.Quote(fs.RelName(yamlFile, conf.OriginalsPath())))
log.Debugf("photo: updated yaml file %s", txt.Quote(filepath.Base(yamlFile)))
}
}
}

View file

@ -175,10 +175,10 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) (
if err := photo.LoadFromYaml(yamlName); err != nil {
log.Errorf("index: %s in %s (restore from yaml)", err.Error(), logName)
} else if err := photo.Find(); err != nil {
log.Infof("index: data restored from %s", txt.Quote(fs.RelName(yamlName, Config().OriginalsPath())))
log.Infof("index: data restored from %s", txt.Quote(filepath.Base(yamlName)))
} else {
photoExists = true
log.Infof("index: uid %s restored from %s", photo.PhotoUID, txt.Quote(fs.RelName(yamlName, Config().OriginalsPath())))
log.Infof("index: uid %s restored from %s", photo.PhotoUID, txt.Quote(filepath.Base(yamlName)))
}
}
}
@ -687,7 +687,7 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) (
if err := photo.SaveAsYaml(yamlFile); err != nil {
log.Errorf("index: %s in %s (update yaml)", err.Error(), logName)
} else {
log.Infof("index: updated yaml file %s", txt.Quote(fs.RelName(yamlFile, Config().OriginalsPath())))
log.Debugf("index: updated yaml file %s", txt.Quote(filepath.Base(yamlFile)))
}
}