better logging

This commit is contained in:
Simon Martens
2024-11-16 17:30:14 +01:00
parent 527fbfa000
commit 84fa6f7fa4
17 changed files with 221 additions and 106 deletions

View File

@@ -3,10 +3,10 @@ package helpers
import (
"errors"
"io/fs"
"log"
"path/filepath"
"sync"
"github.com/Theodor-Springmann-Stiftung/kgpz_web/helpers/logging"
"github.com/fsnotify/fsnotify"
)
@@ -96,7 +96,6 @@ func (fw *FileWatcher) Watch() error {
return
}
if !event.Has(fsnotify.Chmod) {
log.Println("event:", event)
fw.mu.Lock()
for _, wf := range fw.wf {
wf(event.Name)
@@ -107,7 +106,7 @@ func (fw *FileWatcher) Watch() error {
if !ok {
return
}
log.Println("error:", err)
logging.Error(err)
}
}
}()