mirror of
https://github.com/miniflux/v2.git
synced 2025-08-11 17:51:01 +00:00
Implement structured logging using log/slog package
This commit is contained in:
parent
54cb8fa028
commit
c0e954f19d
77 changed files with 1868 additions and 892 deletions
|
@ -7,14 +7,13 @@ import (
|
|||
"strconv"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"miniflux.app/v2/internal/logger"
|
||||
)
|
||||
|
||||
// Path returns the defined route based on given arguments.
|
||||
func Path(router *mux.Router, name string, args ...interface{}) string {
|
||||
func Path(router *mux.Router, name string, args ...any) string {
|
||||
route := router.Get(name)
|
||||
if route == nil {
|
||||
logger.Fatal("[Route] Route not found: %s", name)
|
||||
panic("route not found: " + name)
|
||||
}
|
||||
|
||||
var pairs []string
|
||||
|
@ -29,7 +28,7 @@ func Path(router *mux.Router, name string, args ...interface{}) string {
|
|||
|
||||
result, err := route.URLPath(pairs...)
|
||||
if err != nil {
|
||||
logger.Fatal("[Route] %v", err)
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return result.String()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue