mirror of
https://github.com/miniflux/v2.git
synced 2025-07-02 16: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,17 +5,17 @@
|
|||
package route
|
||||
|
||||
import (
|
||||
"log"
|
||||
"strconv"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/miniflux/miniflux/logger"
|
||||
)
|
||||
|
||||
// Path returns the defined route based on given arguments.
|
||||
func Path(router *mux.Router, name string, args ...interface{}) string {
|
||||
route := router.Get(name)
|
||||
if route == nil {
|
||||
log.Fatalln("Route not found:", name)
|
||||
logger.Fatal("[Route] Route not found: %s", name)
|
||||
}
|
||||
|
||||
var pairs []string
|
||||
|
@ -31,7 +31,7 @@ func Path(router *mux.Router, name string, args ...interface{}) string {
|
|||
|
||||
result, err := route.URLPath(pairs...)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
logger.Fatal("[Route] %v", err)
|
||||
}
|
||||
|
||||
return result.String()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue