From 572b6ccf85ac9745f510cc0fa2f53c1f2a6488f9 Mon Sep 17 00:00:00 2001 From: zicla Date: Mon, 10 Dec 2018 01:44:29 +0800 Subject: [PATCH] Add some logger things. --- rest/footprint_service.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/rest/footprint_service.go b/rest/footprint_service.go index 094c471..57e585d 100644 --- a/rest/footprint_service.go +++ b/rest/footprint_service.go @@ -2,7 +2,6 @@ package rest import ( "encoding/json" - "github.com/json-iterator/go" "net/http" "time" ) @@ -81,11 +80,9 @@ func (this *FootprintService) Trace(writer http.ResponseWriter, request *http.Re } footprint.UserUuid = userUuid footprint = this.footprintDao.Create(footprint) - } else { - //用json的方式输出返回值。 - b, _ := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(footprint) - - this.logger.Info("%s", string(b)) } + //用json的方式输出返回值。 + this.logger.Info("Ip:%s Host:%s Uri:%s Params:%s Cost:%d", footprint.Ip, footprint.Host, footprint.Uri, paramsString, int64(duration/time.Millisecond)) + }