Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logger string interpolation #1104

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

mwu3535
Copy link
Contributor

@mwu3535 mwu3535 commented Feb 29, 2024

Code is raising a panic due to the logger string not being correctly interpolated.

Error I got:

panic: interface conversion: interface {} is int, not string

goroutine 31 [running]:
github.com/newrelic/newrelic-client-go/v2/pkg/logging.createFieldMap(...)
	/Users/mwu/go/pkg/mod/github.com/newrelic/newrelic-client-go/v2@v2.26.0/pkg/logging/logrus_logger.go:101
github.com/newrelic/newrelic-client-go/v2/pkg/logging.LogrusLogger.Trace({0x140002aee78?}, {0x104fe35d2, 0xc}, {0x1400039a7a0?, 0x1400026de01?, 0x1400026de40?})
	/Users/mwu/go/pkg/mod/github.com/newrelic/newrelic-client-go/v2@v2.26.0/pkg/logging/logrus_logger.go:92 +0x1d4
github.com/newrelic/newrelic-client-go/v2/pkg/logs.(*Logs).batchWorker(0x1400091b440, {0x1053d1d38, 0x14000926120}, 0x0)
	/Users/mwu/go/pkg/mod/github.com/newrelic/newrelic-client-go/v2@v2.26.0/pkg/logs/logs_batch.go:161 +0x2e8
github.com/newrelic/newrelic-client-go/v2/pkg/logs.(*Logs).BatchMode.func2(0x8?)
	/Users/mwu/go/pkg/mod/github.com/newrelic/newrelic-client-go/v2@v2.26.0/pkg/logs/logs_batch.go:45 +0x74
created by github.com/newrelic/newrelic-client-go/v2/pkg/logs.(*Logs).BatchMode
	/Users/mwu/go/pkg/mod/github.com/newrelic/newrelic-client-go/v2@v2.26.0/pkg/logs/logs_batch.go:43 +0x220

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 38.90%. Comparing base (acdbc6d) to head (f24a3eb).

Files Patch % Lines
pkg/events/events_batch.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1104   +/-   ##
=======================================
  Coverage   38.90%   38.90%           
=======================================
  Files          86       86           
  Lines        5590     5590           
=======================================
  Hits         2175     2175           
  Misses       3249     3249           
  Partials      166      166           
Flag Coverage Δ
unit 38.90% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@noahmmcgivern noahmmcgivern merged commit 0048a35 into newrelic:main Feb 29, 2024
9 checks passed
noahmmcgivern pushed a commit that referenced this pull request Mar 1, 2024
noahmmcgivern added a commit that referenced this pull request Mar 1, 2024
Co-authored-by: mwu3535 <135672454+mwu3535@users.noreply.github.com>
noahmmcgivern pushed a commit that referenced this pull request Mar 1, 2024
mbazhlekova pushed a commit that referenced this pull request Mar 20, 2024
Co-authored-by: mwu3535 <135672454+mwu3535@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants