From 9a460b9864b32e98a9c1cbdf699bd0fdc79c184f Mon Sep 17 00:00:00 2001 From: Geno Date: Thu, 30 Mar 2017 14:01:01 +0200 Subject: [PATCH] Update log.go --- lib/log.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/log.go b/lib/log.go index 8102921..c8d4892 100644 --- a/lib/log.go +++ b/lib/log.go @@ -8,6 +8,11 @@ import ( Log := log.New() +func DisableTimestamp(value bool) { + Log.SetFormatter(&log.TextFormatter{ + DisableTimestamp: value, + }) +} // LogHTTP to add information of a httprequest to log func LogHTTP(r *http.Request) *log.Entry { ip := r.Header.Get("X-Forwarded-For") @@ -17,6 +22,6 @@ func LogHTTP(r *http.Request) *log.Entry { return Log.WithFields(log.Fields{ "remote": ip, "method": r.Method, - "path": r.URL.Path, + "path": r.URL.Path, }) }