2022-09-28 09:01:17 +02:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/photoprism/photoprism/internal/event"
|
|
|
|
)
|
|
|
|
|
|
|
|
var log = event.Log
|
|
|
|
|
2024-01-18 11:23:59 +01:00
|
|
|
// logErr logs an error if err is not nil.
|
|
|
|
func logErr(prefix string, err error) {
|
2022-09-28 09:01:17 +02:00
|
|
|
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())
|
|
|
|
}
|
|
|
|
}
|