Skip to content

Commit 55f25b8

Browse files
committed
bump v1
1 parent a188d7d commit 55f25b8

File tree

12 files changed

+32
-24
lines changed

12 files changed

+32
-24
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- uses: actions/setup-go@v2
1515
with:
16-
go-version: 1.20.3
16+
go-version: 1.21
1717
stable: false
1818
- uses: actions/checkout@v2
1919
- name: golangci-lint
@@ -41,4 +41,4 @@ jobs:
4141
# skip-build-cache: true
4242

4343
# optionally use a specific version of Go rather than the latest one
44-
go_version: '1.20.3'
44+
go_version: '1.21'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@v2
2020
with:
21-
go-version: 1.20.3
21+
go-version: 1.21
2222
stable: false
2323

2424
- name: Test

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v2
1818
with:
19-
go-version: 1.20.3
19+
go-version: 1.21
2020
stable: false
2121

2222
- name: Build

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Slog sampling policy
33

44
[![tag](https://img.shields.io/github/tag/samber/slog-sampling.svg)](https://github.com/samber/slog-sampling/releases)
5-
![Go Version](https://img.shields.io/badge/Go-%3E%3D%201.20.3-%23007d9c)
5+
![Go Version](https://img.shields.io/badge/Go-%3E%3D%201.21-%23007d9c)
66
[![GoDoc](https://godoc.org/github.com/samber/slog-sampling?status.svg)](https://pkg.go.dev/github.com/samber/slog-sampling)
77
![Build Status](https://github.com/samber/slog-sampling/actions/workflows/test.yml/badge.svg)
88
[![Go report](https://goreportcard.com/badge/github.com/samber/slog-sampling)](https://goreportcard.com/report/github.com/samber/slog-sampling)
@@ -43,11 +43,9 @@ Sampling fixes throughput by dropping repetitive log entries.
4343
go get github.com/samber/slog-sampling
4444
```
4545

46-
**Compatibility**: go >= 1.20.3
46+
**Compatibility**: go >= 1.21
4747

48-
This library is v0 and follows SemVer strictly. On `slog` final release (go 1.21), this library will go v1.
49-
50-
No breaking changes will be made to exported APIs before v1.0.0.
48+
No breaking changes will be made to exported APIs before v2.0.0.
5149

5250
## 💡 Usage
5351

@@ -82,7 +80,7 @@ Using `slog-multi`:
8280
import (
8381
slogmulti "github.com/samber/slog-multi"
8482
slogsampling "github.com/samber/slog-sampling"
85-
"golang.org/x/exp/slog"
83+
"log/slog"
8684
)
8785

8886
// Will print 30% of entries.
@@ -129,7 +127,7 @@ Using `slog-multi`:
129127
import (
130128
slogmulti "github.com/samber/slog-multi"
131129
slogsampling "github.com/samber/slog-sampling"
132-
"golang.org/x/exp/slog"
130+
"log/slog"
133131
)
134132

135133
// Will print the first 10 entries having the same level+message, then every 10th messages until next interval.
@@ -172,7 +170,7 @@ Using `slog-multi`:
172170
import (
173171
slogmulti "github.com/samber/slog-multi"
174172
slogsampling "github.com/samber/slog-sampling"
175-
"golang.org/x/exp/slog"
173+
"log/slog"
176174
)
177175

178176
// Will print 100% of log entries during the night, or 50% of errors, 20% of warnings and 1% of lower levels.

counters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"sync/atomic"
55
"time"
66

7-
"golang.org/x/exp/slog"
7+
"log/slog"
88
)
99

1010
const countersPerLevel = 4096

example/example.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import (
77
"sync/atomic"
88
"time"
99

10+
"log/slog"
11+
1012
slogmulti "github.com/samber/slog-multi"
1113
slogsampling "github.com/samber/slog-sampling"
12-
"golang.org/x/exp/slog"
1314
)
1415

1516
func main() {

go.mod

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
module github.com/samber/slog-sampling
22

3-
go 1.20
3+
go 1.21
44

55
require (
6-
github.com/samber/slog-multi v0.6.0
6+
github.com/samber/slog-multi v1.0.0
77
go.uber.org/goleak v1.2.1
8-
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
98
)
109

11-
require github.com/samber/lo v1.38.1 // indirect
10+
require (
11+
github.com/samber/lo v1.38.1 // indirect
12+
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
13+
)

go.sum

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
23
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
35
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
46
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
5-
github.com/samber/slog-multi v0.6.0 h1:PlkNfE+4HlDz32PdZvVfofEwndsf6Hkjo+SiHdnVZf8=
6-
github.com/samber/slog-multi v0.6.0/go.mod h1:tframyieOY2ATooyXYheljn9FzBCAz+gGxpwWWvtVfg=
7+
github.com/samber/slog-multi v1.0.0 h1:snvP/P5GLQ8TQh5WSqdRaxDANW8AAA3egwEoytLsqvc=
8+
github.com/samber/slog-multi v1.0.0/go.mod h1:uLAvHpGqbYgX4FSL0p1ZwoLuveIAJvBECtE07XmYvFo=
79
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
10+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
811
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
912
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
1013
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=
1114
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
1215
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
16+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

hook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package slogsampling
33
import (
44
"context"
55

6-
"golang.org/x/exp/slog"
6+
"log/slog"
77
)
88

99
func hook(hook func(context.Context, slog.Record), ctx context.Context, record slog.Record) {

middleware_custom.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import (
55
"math/rand"
66
"time"
77

8+
"log/slog"
9+
810
slogmulti "github.com/samber/slog-multi"
9-
"golang.org/x/exp/slog"
1011
)
1112

1213
type CustomSamplingOption struct {

0 commit comments

Comments
 (0)