summaryrefslogtreecommitdiff
path: root/internal/media/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/media/util.go')
-rw-r--r--internal/media/util.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/media/util.go b/internal/media/util.go
index 248d5fb19..f3cd1b986 100644
--- a/internal/media/util.go
+++ b/internal/media/util.go
@@ -23,6 +23,7 @@ import (
"fmt"
"github.com/h2non/filetype"
+ "github.com/sirupsen/logrus"
)
// parseContentType parses the MIME content type from a file, returning it as a string in the form (eg., "image/jpeg").
@@ -103,3 +104,17 @@ func ParseMediaSize(s string) (Size, error) {
}
return "", fmt.Errorf("%s not a recognized MediaSize", s)
}
+
+// logrusWrapper is just a util for passing the logrus logger into the cron logging system.
+type logrusWrapper struct {
+}
+
+// Info logs routine messages about cron's operation.
+func (l *logrusWrapper) Info(msg string, keysAndValues ...interface{}) {
+ logrus.Info("media manager cron logger: ", msg, keysAndValues)
+}
+
+// Error logs an error condition.
+func (l *logrusWrapper) Error(err error, msg string, keysAndValues ...interface{}) {
+ logrus.Error("media manager cron logger: ", err, msg, keysAndValues)
+}