mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
refactor(logs): use zerolog instead of log (#797)
fix(logs): use zerolog instead of log
This commit is contained in:
parent
c2fcd91da7
commit
37261c9432
1 changed files with 3 additions and 3 deletions
|
@ -4,7 +4,6 @@ import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"io"
|
"io"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"log"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
@ -19,6 +18,7 @@ import (
|
||||||
"github.com/dustin/go-humanize"
|
"github.com/dustin/go-humanize"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/go-chi/render"
|
"github.com/go-chi/render"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
type logsHandler struct {
|
type logsHandler struct {
|
||||||
|
@ -153,7 +153,7 @@ func SanitizeLogFile(filePath string, output io.Writer) error {
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != io.EOF {
|
if err != io.EOF {
|
||||||
log.Printf("Error reading line from input file: %v", err)
|
log.Error().Msgf("Error reading line from input file: %v", err)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ func SanitizeLogFile(filePath string, output io.Writer) error {
|
||||||
|
|
||||||
// Write the sanitized line to the writer
|
// Write the sanitized line to the writer
|
||||||
if _, err = writer.WriteString(line); err != nil {
|
if _, err = writer.WriteString(line); err != nil {
|
||||||
log.Printf("Error writing line to output: %v", err)
|
log.Error().Msgf("Error writing line to output: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue