From 19c3a5b41c86713c3c59185e9c290409aefa1286 Mon Sep 17 00:00:00 2001 From: astaxie Date: Wed, 9 Jul 2014 09:38:36 +0800 Subject: [PATCH] beego: improve the router debug infomation --- router.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/router.go b/router.go index eba65c51..ba0d0b60 100644 --- a/router.go +++ b/router.go @@ -756,11 +756,13 @@ Admin: } if RunMode == "dev" { + var devinfo string if findrouter { - Info("beego: router defined " + routerInfo.pattern + " " + r.URL.Path + " +" + timeend.String()) + devinfo = fmt.Sprintf("| % -10s| % -16s | % -10s | % -40s | % -10s | % -40s |", "beego", timeend.String(), r.Method, r.URL.Path, "match", routerInfo.pattern) } else { - Info("beego:" + r.URL.Path + " 404" + " +" + timeend.String()) + devinfo = fmt.Sprintf("| % -10s| % -16s | % -10s | % -40s | % -10s |", "beego", timeend.String(), r.Method, r.URL.Path, "notmatch") } + Info(devinfo) } // Call WriteHeader if status code has been set changed