From f4b9da88f37796e1f2261390264cd0486bae7560 Mon Sep 17 00:00:00 2001 From: kun Date: Tue, 6 Aug 2019 09:41:51 +0800 Subject: [PATCH] print less log --- main.go | 1 - proxy/router.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 0aa91ed..1bc4066 100644 --- a/main.go +++ b/main.go @@ -126,7 +126,6 @@ func (r *responseLogger) WriteHeader(code int) { r.ResponseWriter.WriteHeader(code) } func (l *logger) ServeHTTP(w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(os.Stderr, "------ --- %s\n", r.URL) start := time.Now() rl := &responseLogger{code: 200, ResponseWriter: w} l.h.ServeHTTP(rl, r) diff --git a/proxy/router.go b/proxy/router.go index abd9b08..3899456 100644 --- a/proxy/router.go +++ b/proxy/router.go @@ -60,11 +60,11 @@ func (rt *Router) Direct(path string) bool { func (rt *Router) ServeHTTP(w http.ResponseWriter, r *http.Request) { if rt.proxy != nil && rt.Direct(r.URL.Path) { - fmt.Fprintf(os.Stdout, "[direct] %s\n", r.URL) + fmt.Fprintf(os.Stderr, "------ --- %s [direct]\n", r.URL) rt.srv.ServeHTTP(w, r) return } - fmt.Fprintf(os.Stdout, "[proxy] %s\n", r.URL) + fmt.Fprintf(os.Stderr, "------ --- %s [proxy]\n", r.URL) rt.proxy.ServeHTTP(w, r) return }