Unify the pattern of using a package-level logger (#8245)

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
This commit is contained in:
Radosław Kapka
2021-01-11 21:03:28 +01:00
committed by GitHub
parent 18bb86754a
commit 5fd03f8fb0
127 changed files with 281 additions and 146 deletions

View File

@@ -8,6 +8,7 @@ go_library(
srcs = [
"doc.go",
"handler.go",
"log.go",
":site_data", # keep
],
importpath = "github.com/prysmaticlabs/prysm/validator/web",

View File

@@ -5,16 +5,10 @@ import (
"net/http"
"net/url"
"path"
"github.com/sirupsen/logrus"
)
const prefix = "external/prysm_web_ui/prysm-web-ui"
var (
log = logrus.WithField("prefix", "prysm-web")
)
// Handler serves web requests from the bundled site data.
var Handler = func(res http.ResponseWriter, req *http.Request) {
u, err := url.ParseRequestURI(req.RequestURI)

5
validator/web/log.go Normal file
View File

@@ -0,0 +1,5 @@
package web
import "github.com/sirupsen/logrus"
var log = logrus.WithField("prefix", "prysm-web")