Update log.go
This commit is contained in:
parent
6be78175a7
commit
9a460b9864
|
@ -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")
|
||||||
|
|
Reference in New Issue