photoprism/internal/api/api_log.go
Michael Mayer 271e7243db Logs: Shorten the names of error log helper functions
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-01-18 11:23:59 +01:00

21 lines
398 B
Go

package api
import (
"github.com/photoprism/photoprism/internal/event"
)
var log = event.Log
// logErr logs an error if err is not nil.
func logErr(prefix string, err error) {
if err != nil {
log.Errorf("%s: %s", prefix, err.Error())
}
}
// logWarn logs a warning if err is not nil.
func logWarn(prefix string, err error) {
if err != nil {
log.Warnf("%s: %s", prefix, err.Error())
}
}