Backend: Improve log messages

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2019-12-05 02:52:00 +01:00
parent fc3d319dfd
commit 309317d23d
2 changed files with 3 additions and 2 deletions

View file

@ -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"})
})

View file

@ -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)
}