mirror of
https://github.com/adnanh/webhook.git
synced 2025-10-04 21:51:02 +00:00
fix: Fix 1.19 incompatibilities
This commit is contained in:
parent
5730b0e588
commit
5f59f90f9c
11 changed files with 38 additions and 29 deletions
|
@ -39,13 +39,13 @@ type LogEntry struct {
|
|||
}
|
||||
|
||||
// Write constructs and writes the final log entry.
|
||||
func (l *LogEntry) Write(status, totalBytes int, elapsed time.Duration) {
|
||||
func (l *LogEntry) Write(status int, bytes int, header http.Header, elapsed time.Duration, extra interface{}) {
|
||||
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)
|
||||
fmt.Fprintf(l.buf, "%03d | %s | %s | ", status, humanize.IBytes(uint64(bytes)), elapsed)
|
||||
l.buf.WriteString(l.req.Host + " | " + l.req.Method + " " + l.req.RequestURI)
|
||||
log.Print(l.buf.String())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue