From 309317d23d863792848a3bc22449d5273cd5a079 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Thu, 5 Dec 2019 02:52:00 +0100 Subject: [PATCH] Backend: Improve log messages Signed-off-by: Michael Mayer --- internal/api/settings.go | 1 + internal/photoprism/search.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/api/settings.go b/internal/api/settings.go index dc803f0a9..24ff0cf7f 100644 --- a/internal/api/settings.go +++ b/internal/api/settings.go @@ -44,6 +44,7 @@ func SaveSettings(router *gin.RouterGroup, conf *config.Config) { } event.Publish("config.updated", event.Data(conf.ClientConfig())) + log.Infof("settings saved") c.JSON(http.StatusOK, gin.H{"message": "saved"}) }) diff --git a/internal/photoprism/search.go b/internal/photoprism/search.go index 3fad346a5..ba8e6d97b 100644 --- a/internal/photoprism/search.go +++ b/internal/photoprism/search.go @@ -106,6 +106,8 @@ func (s *Search) Photos(form forms.PhotoSearchForm) (results []PhotoSearchResult q = q.Where("labels.label_slug = ? OR LOWER(photo_title) LIKE ? OR files.file_main_color = ?", slugString, likeString, lowerString) } else { + log.Infof("search: label \"%s\"", form.Query) + labelIds = append(labelIds, label.ID) s.db.Where("category_id = ?", label.ID).Find(&categories) @@ -114,8 +116,6 @@ func (s *Search) Photos(form forms.PhotoSearchForm) (results []PhotoSearchResult labelIds = append(labelIds, category.LabelID) } - log.Infof("search: labels %#v", form.Query) - q = q.Where("labels.id IN (?) OR LOWER(photo_title) LIKE ? OR files.file_main_color = ?", labelIds, likeString, lowerString) }