Skip to content

Commit d3aaecc

Browse files
committed
add: newline
1 parent 7e803e8 commit d3aaecc

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

middleware.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func RequestLogging(config *Config) func(http.Handler) http.Handler {
2929

3030
next.ServeHTTP(wrw, r)
3131
}
32+
3233
return http.HandlerFunc(fn)
3334
}
3435
}
@@ -53,6 +54,7 @@ func RequestLoggingWithEcho(config *Config) echo.MiddlewareFunc {
5354

5455
return next(c)
5556
}
57+
5658
return fn
5759
}
5860
}
@@ -207,10 +209,12 @@ func writeRequestLog(r *http.Request, config *Config, status int, responseSize i
207209
},
208210
AdditionalData: config.AdditionalData,
209211
}
212+
210213
requestLogJson, err := json.Marshal(requestLog)
211214
if err != nil {
212215
return err
213216
}
217+
214218
requestLogJson = append(requestLogJson, '\n')
215219

216220
_, err = config.RequestLogOut.Write(requestLogJson)
@@ -227,11 +231,13 @@ func getServerIp() string {
227231
if err != nil {
228232
return ""
229233
}
234+
230235
for _, i := range ifaces {
231236
addrs, err := i.Addrs()
232237
if err != nil {
233238
return ""
234239
}
240+
235241
for _, addr := range addrs {
236242
if ipnet, ok := addr.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
237243
if ipnet.IP.To4() != nil {
@@ -240,5 +246,6 @@ func getServerIp() string {
240246
}
241247
}
242248
}
249+
243250
return ""
244251
}

stackdriver.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,5 +311,6 @@ func (l *ContextLogger) maxSeverity() Severity {
311311
max = s
312312
}
313313
}
314+
314315
return max
315316
}

0 commit comments

Comments
 (0)