Skip to content

Commit

Permalink
release otelslog/0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Nekrasov committed Dec 24, 2023
1 parent de40a6c commit 3c92bfe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions otelslog/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

## [v0.1.1] 2023-12-24

### Added

- public option `Level` in HandlerOptions

## [v0.1.0] 2023-11-11

### Added

- Implementation for WithGroup, WithAttrs, Configuration for slog.Level

## [v0.0.1] 2023-09-20

### Added
Expand Down
6 changes: 3 additions & 3 deletions otelslog/otel_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type OtelHandler struct {
// HandlerOptions are options for a OtelHandler.
// A zero HandlerOptions consists entirely of default values.
type HandlerOptions struct {
level slog.Leveler
Level slog.Leveler
}

type otelHandler struct {
Expand All @@ -63,8 +63,8 @@ var instrumentationScope = instrumentation.Scope{

func (o otelHandler) Enabled(ctx context.Context, level slog.Level) bool {
minLevel := slog.LevelInfo
if o.opts.level != nil {
minLevel = o.opts.level.Level()
if o.opts.Level != nil {
minLevel = o.opts.Level.Level()
}
return level >= minLevel
}
Expand Down

0 comments on commit 3c92bfe

Please sign in to comment.