diff --git a/attrs.go b/attrs.go index 207403b..d803368 100644 --- a/attrs.go +++ b/attrs.go @@ -21,12 +21,12 @@ func writeAttr(w *buffer, attr slog.Attr, prefix string) { } switch attr.Value.Kind() { - case slog.GroupKind: + case slog.KindGroup: attrs := attr.Value.Group() for i := range attrs { writeAttr(w, attrs[i], name) } - case slog.LogValuerKind: + case slog.KindLogValuer: attr := slog.Attr{Key: name, Value: attr.Value.Resolve()} writeAttr(w, attr, "") default: diff --git a/go.mod b/go.mod index a87957a..0362cd9 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/mdigger/graylog go 1.19 -require golang.org/x/exp v0.0.0-20230113152452-c42ee1cf562e +require golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 diff --git a/go.sum b/go.sum index 0e0c44e..76269ec 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,4 @@ golang.org/x/exp v0.0.0-20230113152452-c42ee1cf562e h1:uGuXqQsI2BAE8xNqSqNxhTdDdhlvpBvWFw/KBwtCtjI= golang.org/x/exp v0.0.0-20230113152452-c42ee1cf562e/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 h1:LGJsf5LRplCck6jUCH3dBL2dmycNruWNF5xugkSlfXw= +golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= diff --git a/handler.go b/handler.go index 78b5394..1424b8e 100644 --- a/handler.go +++ b/handler.go @@ -1,6 +1,7 @@ package graylog import ( + "context" "strconv" "time" @@ -14,12 +15,12 @@ type handler struct { } // Enabled reports whether the handler handles records at the slog.DebugLevel. -func (h handler) Enabled(l slog.Level) bool { +func (h handler) Enabled(_ context.Context, l slog.Level) bool { return l >= slog.LevelDebug } // Handle send the log Record to Graylog server. -func (h handler) Handle(r slog.Record) error { +func (h handler) Handle(_ context.Context, r slog.Record) error { buf := newBuffer() defer buf.Free() @@ -58,12 +59,12 @@ func (h handler) Handle(r slog.Record) error { buf.WriteString(strconv.Quote(h.w.facility)) } - // add source file info on warning and errors only - if r.Level >= slog.LevelWarn { - if file, line := r.SourceLine(); line != 0 { - _ = writeAttrValue(buf, "file", file+":"+strconv.Itoa(line)) - } - } + // FIXME: add source file info on warning and errors only + // if r.Level >= slog.LevelWarn { + // if file, line := r.SourceLine(); line != 0 { + // _ = writeAttrValue(buf, "file", file+":"+strconv.Itoa(line)) + // } + // } // add stored attributes if len(h.attrs) > 0 {