Skip to content

Conversation

@mbark
Copy link
Contributor

@mbark mbark commented May 15, 2025

When going through some logging inconsistencies locally I noticed that oops doesn't actually implement the LogValuer interface. Instead slog uses json.Marshal when logging (if you're logging as json).

The interface is defined as follows:

type LogValuer interface {
	LogValue() [Value](https://pkg.go.dev/log/slog#Value)
}

However, the implementation in oops is

func (o OopsError) LogValuer() slog.Value {
...
}

That is, the function is called LogValuer not LogValue!

This PR fixes this and also adds _ slog.LogValuer = (*OopsError)(nil) for clarity as well.

@codecov
Copy link

codecov bot commented May 21, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 75.54%. Comparing base (367f25c) to head (cae3ca8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
error.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #64      +/-   ##
==========================================
- Coverage   75.69%   75.54%   -0.15%     
==========================================
  Files          13       13              
  Lines        1049     1051       +2     
==========================================
  Hits          794      794              
- Misses        224      226       +2     
  Partials       31       31              
Flag Coverage Δ
unittests 75.54% <50.00%> (-0.15%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samber
Copy link
Owner

samber commented May 21, 2025

Thanks!

@samber samber merged commit 1bdea12 into samber:main May 21, 2025
7 of 9 checks passed
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.

2 participants