photoprism/internal/api/api_log.go
Michael Mayer f5a8c5a45d Auth: Session and ACL enhancements #98 #1746
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-09-28 09:01:17 +02:00

21 lines
402 B
Go

package api
import (
"github.com/photoprism/photoprism/internal/event"
)
var log = event.Log
// logError logs an error if err is not nil.
func logError(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())
}
}