1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Implement structured logging using log/slog package

This commit is contained in:
Frédéric Guillot 2023-09-24 16:32:09 -07:00
parent 54cb8fa028
commit c0e954f19d
77 changed files with 1868 additions and 892 deletions

View file

@ -8,11 +8,10 @@ import (
"compress/gzip"
"fmt"
"io"
"log/slog"
"net/http"
"strings"
"time"
"miniflux.app/v2/internal/logger"
)
const compressionThreshold = 1024
@ -91,7 +90,7 @@ func (b *Builder) Write() {
b.writeHeaders()
_, err := io.Copy(b.w, v)
if err != nil {
logger.Error("%v", err)
slog.Error("Unable to write response body", slog.Any("error", err))
}
}
}