Skip to content

Commit 1511423

Browse files
committed
logger: fix panic and import cycle
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
1 parent b55375f commit 1511423

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

logger/options.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"slices"
99
"time"
1010

11-
"go.unistack.org/micro/v4/logger"
1211
"go.unistack.org/micro/v4/meter"
1312
)
1413

@@ -86,7 +85,7 @@ func NewOptions(opts ...Option) Options {
8685
return options
8786
}
8887

89-
func WithCallerEnabled(b bool) logger.Option {
88+
func WithCallerEnabled(b bool) Option {
9089
return func(o *Options) {
9190
o.AddCaller = b
9291
}

logger/slog/slog.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ func (s *slogLogger) Init(opts ...logger.Option) error {
213213
}
214214

215215
s.handler = &wrapper{
216-
h: h.WithAttrs(attrs),
217-
level: atomic.LoadInt64(&s.handler.level),
216+
h: h.WithAttrs(attrs),
218217
}
218+
219219
atomic.StoreInt64(&s.handler.level, int64(loggerToSlogLevel(s.opts.Level)))
220220
s.mu.Unlock()
221221

0 commit comments

Comments
 (0)