diff options
author | Alan Pearce | 2024-05-19 15:42:36 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-19 15:53:32 +0200 |
commit | 09ee2de72936ea0b0edc5d3360ce1c72803a817b (patch) | |
tree | 427a590fba06e58554586aad8995fcb6e7a559f3 /internal/server/filemap.go | |
parent | 4064f933a965f2fb2ce43d3c2d5bd54ccd33978c (diff) | |
download | website-09ee2de72936ea0b0edc5d3360ce1c72803a817b.tar.lz website-09ee2de72936ea0b0edc5d3360ce1c72803a817b.tar.zst website-09ee2de72936ea0b0edc5d3360ce1c72803a817b.zip |
log in logfmt via zap, with nicer console output in dev
Diffstat (limited to 'internal/server/filemap.go')
-rw-r--r-- | internal/server/filemap.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/server/filemap.go b/internal/server/filemap.go index 466db49..6130e65 100644 --- a/internal/server/filemap.go +++ b/internal/server/filemap.go @@ -5,12 +5,12 @@ import ( "hash/fnv" "io" "io/fs" - "log" - "log/slog" "os" "path/filepath" "strings" + "website/internal/log" + "github.com/pkg/errors" ) @@ -36,7 +36,7 @@ func hashFile(filename string) (string, error) { func registerFile(urlpath string, filepath string) error { if files[urlpath] != (File{}) { - log.Printf("registerFile called with duplicate file, urlPath: %s", urlpath) + log.Info("registerFile called with duplicate file", "url_path", urlpath) return nil } hash, err := hashFile(filepath) @@ -61,7 +61,7 @@ func registerContentFiles(root string) error { } urlPath, _ := strings.CutSuffix(relPath, "index.html") if !f.IsDir() { - slog.Debug("registering file", "urlpath", "/"+urlPath) + log.Debug("registering file", "urlpath", "/"+urlPath) return registerFile("/"+urlPath, filePath) } return nil |