func (l *LogEntry) Write(status, totalBytes int, elapsed time.Duration) {
	rid := GetReqID(l.req.Context())
	if rid != "" {
		fmt.Fprintf(l.buf, "[%s] ", rid)
	}
	fmt.Fprintf(l.buf, "%03d | %s | %s | ", status, humanize.IBytes(uint64(totalBytes)), elapsed)
	l.buf.WriteString(l.req.Host + " | " + l.req.Method + " " + l.req.RequestURI)
	log.Print(l.buf.String())
}
Write constructs and writes the final log entry.
package middleware
import (
	"bytes"
	"fmt"
	"log"
	"net/http"
	"time"
	"github.com/dustin/go-humanize"
	"github.com/go-chi/chi/middleware"
)
type Logger struct {
	Logger middleware.LoggerInterface
}
func NewLogger() func(next http.Handler) http.Handler {
	return middleware.RequestLogger(&Logger{})
}
func (l *Logger) NewLogEntry(r *http.Request) middleware.LogEntry {
	e := &LogEntry{
		req: r,
		buf: &bytes.Buffer{},
	}
	return e
}
type LogEntry struct {
	*Logger
	req *http.Request
	buf *bytes.Buffer
}