gzip compressed log/file
go get -u github.com/stokito/[email protected]
package main
import (
"github.com/stokito/go-gzip-buf-file"
"log"
)
func main() {
requestResponseDump, err := gzip_log.NewGzBufFile("request_log.ndjson.gz")
if err != nil {
log.Printf("init log failed %s\n", err.Error())
}
requestResponseDump.WriteTwoLines(requestBody, responseData)
if requestResponseDump != nil {
requestResponseDump.Close()
}
}
0BSD (similar to Public Domain)