mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Add logger
This commit is contained in:
parent
c6d9eb3614
commit
1d8193b892
56 changed files with 228 additions and 192 deletions
|
@ -5,9 +5,9 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/miniflux/miniflux/logger"
|
||||
"github.com/miniflux/miniflux/server/template"
|
||||
)
|
||||
|
||||
|
@ -30,7 +30,7 @@ func (h *HTMLResponse) ServerError(err error) {
|
|||
h.writer.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
logger.Error("[Internal Server Error] %v", err)
|
||||
h.writer.Write([]byte("Internal Server Error: " + err.Error()))
|
||||
} else {
|
||||
h.writer.Write([]byte("Internal Server Error"))
|
||||
|
@ -43,7 +43,7 @@ func (h *HTMLResponse) BadRequest(err error) {
|
|||
h.writer.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
logger.Error("[Bad Request] %v", err)
|
||||
h.writer.Write([]byte("Bad Request: " + err.Error()))
|
||||
} else {
|
||||
h.writer.Write([]byte("Bad Request"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue