Skip to content

Commit ce7c813

Browse files
committed
Move started output to beginning of method
1 parent 136cf01 commit ce7c813

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

logrequest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ type statusWriter struct {
2222

2323
// ToLogger will print the Started and Completed request info to the passed logger
2424
func (lr LogRequest) ToLogger(logger *log.Logger) {
25-
sw, completedDuration := lr.parseRequest()
2625
logger.Printf(`Started %s "%s" %s %s`, lr.Request.Method, lr.Request.URL.RequestURI(), lr.Request.RemoteAddr, lr.Request.Proto)
26+
sw, completedDuration := lr.parseRequest()
2727
logger.Printf("Completed %d in %s", sw.statusCode, completedDuration)
2828
}
2929

0 commit comments

Comments
 (0)