Use logrus logger

This commit is contained in:
Tyler
2022-03-30 21:18:25 -04:00
parent 164964a127
commit cb8b3a084f
3 changed files with 624 additions and 5 deletions

1
go.mod
View File

@@ -3,6 +3,7 @@ module meow.tf/armbian-router
go 1.17
require (
github.com/chi-middleware/logrus-logger v0.2.0
github.com/go-chi/chi/v5 v5.0.7
github.com/oschwald/maxminddb-golang v1.8.0
github.com/prometheus/client_golang v1.11.0

624
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
package main
import (
"github.com/chi-middleware/logrus-logger"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/oschwald/maxminddb-golang"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
@@ -97,7 +97,7 @@ func main() {
r := chi.NewRouter()
r.Use(RealIPMiddleware)
r.Use(middleware.Logger)
r.Use(logger.Logger("router", log.StandardLogger()))
r.HandleFunc("/status", statusHandler)
r.HandleFunc("/mirrors", mirrorsHandler)