export httpx.GetRemoteAddr

This commit is contained in:
kevin
2020-08-12 12:25:52 +08:00
committed by kingxt
parent c637f86817
commit 9428fface2
6 changed files with 11 additions and 10 deletions

View File

@@ -7,6 +7,7 @@ import (
"sync"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/rest/httpx"
)
const LogContext = "request_logs"
@@ -79,5 +80,5 @@ func formatf(r *http.Request, format string, v ...interface{}) string {
}
func formatWithReq(r *http.Request, v string) string {
return fmt.Sprintf("(%s - %s) %s", r.RequestURI, GetRemoteAddr(r), v)
return fmt.Sprintf("(%s - %s) %s", r.RequestURI, httpx.GetRemoteAddr(r), v)
}