https://github.com/nakabonne/talkativeness
A package that outputs frequently used logs
https://github.com/nakabonne/talkativeness
go golang http log package
Last synced: about 1 year ago
JSON representation
A package that outputs frequently used logs
- Host: GitHub
- URL: https://github.com/nakabonne/talkativeness
- Owner: nakabonne
- License: mit
- Created: 2017-10-15T07:38:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-21T14:03:49.000Z (about 8 years ago)
- Last Synced: 2025-03-27T03:11:15.562Z (about 1 year ago)
- Topics: go, golang, http, log, package
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# talkativeness
A package that outputs frequently used logs
# Usage
```go
import "github.com/ryonakao/talkativeness"
func handler(w http.ResponseWriter, req *http.Request) {
talkativeness.LogRequest(req, true)
}
```
A log is output
```
>>Request message<<
GET /room HTTP/1.1
Host: localhost:8080
Accept-Encoding: gzip, deflate, br
Accept-Language: ja,en-US;q=0.8,en;q=0.6
Cache-Control: no-cache
Connection: Upgrade
Origin: http://localhost:8080
Pragma: no-cache
Sec-Websocket-Extensions: permessage-deflate; client_max_window_bits
Sec-Websocket-Key: R1RGOCJKDkHksrbfEqPuTg==
Sec-Websocket-Version: 13
Upgrade: websocket
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
```
# Installation
```
$ go get -u github.com/nakabonne/talkativeness
```
# License
`talkativeness` source code is available under the MIT [License](https://github.com/ryonakao/talkativeness/blob/master/LICENSE).