diff options
| author | Marc Pervaz Boocha <mboocha@sudomsg.com> | 2026-02-27 21:18:28 +0530 |
|---|---|---|
| committer | Marc Pervaz Boocha <mboocha@sudomsg.com> | 2026-02-27 21:18:28 +0530 |
| commit | a451b3008e17167198da38ec627bb28d8af084de (patch) | |
| tree | b1e30744d58bf7f0a770d8da6fdb949d74fdd88b /logging/http | |
| parent | Misc Fixes (diff) | |
| download | kit-a451b3008e17167198da38ec627bb28d8af084de.tar kit-a451b3008e17167198da38ec627bb28d8af084de.tar.gz kit-a451b3008e17167198da38ec627bb28d8af084de.tar.bz2 kit-a451b3008e17167198da38ec627bb28d8af084de.tar.lz kit-a451b3008e17167198da38ec627bb28d8af084de.tar.xz kit-a451b3008e17167198da38ec627bb28d8af084de.tar.zst kit-a451b3008e17167198da38ec627bb28d8af084de.zip | |
Add Syslog and refactored the Sink api
Diffstat (limited to 'logging/http')
| -rw-r--r-- | logging/http/http_test.go | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/logging/http/http_test.go b/logging/http/http_test.go index 832b49e..e12b9b2 100644 --- a/logging/http/http_test.go +++ b/logging/http/http_test.go @@ -80,20 +80,14 @@ func TestNew(t *testing.T) { t.Fatalf("expected 1 log record, got %d", len(records)) } - record := records[0] - - attrs := map[string]slog.Value{} - record.Attrs(func(a slog.Attr) bool { - attrs[a.Key] = a.Value - return true - }) + attrs := records[0] method := attrs["method"] - if got := method.String(); got != tt.method { + if got := method.(string); got != tt.method { t.Fatalf("expected %v log record, got %v", tt.method, got) } status := attrs["status"] - if got := int(status.Int64()); got != tt.status { + if got := int(status.(int64)); got != tt.status { t.Fatalf("expected %v log record, got %v", tt.status, got) } @@ -103,11 +97,11 @@ func TestNew(t *testing.T) { } host := attrs["host"] - if got := host.String(); got != url.Host { + if got := host.(string); got != url.Host { t.Fatalf("expected %v log record, got %v", url.Host, got) } path := attrs["path"] - if got := path.String(); got != url.RequestURI() { + if got := path.(string); got != url.RequestURI() { t.Fatalf("expected %v log record, got %v", url.RequestURI(), got) } }) |
