Skip to content

Releases: veqryn/slog-context

v0.7.0

01 Apr 07:09
e44c955
Compare
Choose a tag to compare

What's Changed

  • Http middleware by @veqryn in #21
    sloghttp.ExtractAttrCollection extractor will automatically add to the log
    record any attributes added by sloghttp.With after the sloghttp.AttrCollection
    http middleware. This allows other middlewares to log with attributes that would
    normally be out of scope, because they were added by a later middleware or the
    final http handler in the chain.

Full Changelog: v0.6.0...v0.7.0

v0.6.0

26 Mar 08:29
c6b21ed
Compare
Choose a tag to compare

What's Changed

  • Error slog attribute by @veqryn in #19
    slogctx.Err(...)

Full Changelog: v0.5.1...v0.6.0

v0.5.1

10 Mar 08:33
Compare
Choose a tag to compare
  • Support for Golang 1.22 (in addition to 1.21)
  • Additional tests
  • Updated docs
  • License updated to MIT

v0.5.0

03 Jan 08:04
Compare
Choose a tag to compare

Breaking Changes

Package function ToCtx renamed to NewCtx.
Package function Logger renamed to FromCtx.

Package renamed from slogcontext to slogctx.
To fix, change this:

import "github.com/veqryn/slog-context"
var h = slogcontext.NewHandler(slog.NewJSONHandler(os.Stdout, nil), nil)

To this:

import "github.com/veqryn/slog-context"
var h = slogctx.NewHandler(slog.NewJSONHandler(os.Stdout, nil), nil)

Named imports are unaffected.

v0.4.0

27 Dec 22:11
Compare
Choose a tag to compare

Added compatibility with Logr:
slog-context is now compatible with both standard library slog and with logr, which is an alternative logging api/interface/frontend.

If only slog is used, only *slog.Logger's will be stored in the context.
If both slog and logr are used, *slog.Logger will be automatically converted to a logr.Logger as needed, and vice versa. This allows full interoperability up and down the stack and with any libraries that use either slog-context or logr.

v0.3.0

26 Nov 10:31
0d5ce8f
Compare
Choose a tag to compare

Added a convenience method that allow the handler to be created as github.com/samber/slog-multi middleware, in order to easily setup slog workflows such as pipeslines, fanout, routing, failover, etc.

v0.2.2

17 Nov 23:34
ef8b17a
Compare
Choose a tag to compare

Fixed examples module

v0.2.1

17 Nov 12:47
675c5bc
Compare
Choose a tag to compare

Fixed otel go module

v0.2.0

17 Nov 12:21
d786613
Compare
Choose a tag to compare
  • Added support for custom context value extractors.
  • Added support for OTEL (OpenTelemetry) TraceID and SpanID extraction.

v0.1.0

16 Nov 10:21
360ff98
Compare
Choose a tag to compare

Initial github.com/veqryn/slog-context release