add log convenience function
This commit is contained in:
parent
81aa0b651e
commit
f729160209
2 changed files with 10 additions and 3 deletions
|
|
@ -1,10 +1,14 @@
|
|||
package app
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/go-chi/chi"
|
||||
"github.com/go-pg/pg"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/dhax/go-base/database"
|
||||
"github.com/dhax/go-base/logging"
|
||||
)
|
||||
|
||||
type ctxKey int
|
||||
|
|
@ -37,3 +41,7 @@ func (a *API) Router() *chi.Mux {
|
|||
|
||||
return r
|
||||
}
|
||||
|
||||
func log(r *http.Request) logrus.FieldLogger {
|
||||
return logging.GetLogEntry(r)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue