genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0

Update log.go

This commit is contained in:
Geno 2017-03-30 14:01:01 +02:00 committed by GitHub
parent 6be78175a7
commit 9a460b9864
1 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,11 @@ import (
Log := log.New() Log := log.New()
func DisableTimestamp(value bool) {
Log.SetFormatter(&log.TextFormatter{
DisableTimestamp: value,
})
}
// LogHTTP to add information of a httprequest to log // LogHTTP to add information of a httprequest to log
func LogHTTP(r *http.Request) *log.Entry { func LogHTTP(r *http.Request) *log.Entry {
ip := r.Header.Get("X-Forwarded-For") ip := r.Header.Get("X-Forwarded-For")