Skip to content

Commit

Permalink
fix: change SugaredLoggerWithCtx.Desuger to return LoggerWithCtx
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Sep 5, 2022
1 parent c95f027 commit 12f061e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# OpenTelemetry instrumentations for Go

[![build workflow](https://github.com/uptrace/opentelemetry-go-extra/actions/workflows/build.yml/badge.svg)](https://github.com/uptrace/opentelemetry-go-extra/actions/workflows/build.yml)
[![Chat](https://discordapp.com/api/guilds/1000404569202884628/widget.png)](https://discord.gg/YF8tdP8Pmk)
[![Chat](https://img.shields.io/badge/-telegram-red?color=white&logo=telegram&logoColor=black)](https://t.me/uptrace)

| Instrumentation Package | Metrics | Traces |
| ------------------------------- | ------------------ | ------------------ |
Expand Down
7 changes: 5 additions & 2 deletions otelzap/otelzap.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,11 @@ type SugaredLoggerWithCtx struct {
// is quite inexpensive, so it's reasonable for a single application to use
// both Loggers and SugaredLoggers, converting between them on the boundaries
// of performance-sensitive code.
func (s SugaredLoggerWithCtx) Desugar() *Logger {
return s.s.Desugar()
func (s SugaredLoggerWithCtx) Desugar() LoggerWithCtx {
return LoggerWithCtx{
ctx: s.ctx,
l: s.s.Desugar(),
}
}

// Debugf uses fmt.Sprintf to log a templated message.
Expand Down

0 comments on commit 12f061e

Please sign in to comment.