feat: add configurable loglevel
This commit is contained in:
@@ -23,7 +23,7 @@ func CategorizeMediaType(ext string) (MediaType, bool) {
|
||||
case ".pptx", ".ppt", ".key", ".odp":
|
||||
return Presentation, true
|
||||
default:
|
||||
slog.Debug("marking file as invalid undefined extension")
|
||||
slog.Debug("marking file as invalid due to its undefined extension")
|
||||
return "", false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ func databaseGather(db *gorm.DB) (map[string]File, error) {
|
||||
}
|
||||
|
||||
func watchdog(env utility.Environment, db *gorm.DB) {
|
||||
slog.Info("performing the watchdog cycle")
|
||||
slog.Debug("performing the watchdog cycle")
|
||||
|
||||
fsSet, err := filesystemGather(env)
|
||||
if err != nil {
|
||||
@@ -102,7 +102,7 @@ func watchdog(env utility.Environment, db *gorm.DB) {
|
||||
case "strict":
|
||||
err := utility.RemoveFile(fp)
|
||||
if err != nil {
|
||||
slog.Warn("failed to remove local file from the filesystem", "error", err)
|
||||
slog.Error("failed to remove local file from the filesystem", "error", err)
|
||||
}
|
||||
case "dry":
|
||||
slog.Debug("dry mode enabled, not purging", "filepath", fp)
|
||||
|
||||
Reference in New Issue
Block a user