Skip to content

Commit 3b27027

Browse files
authored
Update readme with new HideDuration option
1 parent d580fb1 commit 3b27027

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ go get -u github.com/aaronvb/logrequest
1818
## Options
1919
There are two optional options you can pass to the `LogRequest` struct:
2020

21-
`NewLine` (integer) - This will append N lines at the end of the log output. Note: This only works with logger output.
21+
#### `NewLine` (integer) - This will append N lines at the end of the log output. Note: This only works with logger output.
2222

2323
Example:
2424
```go
@@ -33,7 +33,7 @@ Started GET "/home" 127.0.0.1:12345 HTTP/1.1
3333
Completed 200 in 1.891ms
3434
```
3535

36-
`Timestamp` (boolean) - This will add a timestamp at the beginning of the request.
36+
#### `Timestamp` (boolean) - This will add a timestamp at the beginning of the request.
3737

3838
Example:
3939
```go
@@ -43,6 +43,17 @@ lr := logrequest.LogRequest{Request: r, Writer: w, Handler: next, Timestamp: tru
4343
Started GET "/home" 1.1.1.1:1234 HTTP/1.1 at 2020-05-13 02:25:33
4444
```
4545

46+
#### `HideDuration` (boolean) - This will hide the duration at the end of the request.
47+
48+
Example:
49+
```go
50+
lr := logrequest.LogRequest{Request: r, Writer: w, Handler: next, Timestamp: true, HideDuration: true}
51+
```
52+
```
53+
Started GET "/home" 127.0.0.1:12345 HTTP/1.1
54+
Completed 200
55+
```
56+
4657
## Middleware Example (using [gorilla/mux](https://github.com/gorilla/mux))
4758
```go
4859
package main

0 commit comments

Comments
 (0)