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

feat: migrate to slog.Logger #31

Merged
merged 8 commits into from
Mar 11, 2024
Merged

feat: migrate to slog.Logger #31

merged 8 commits into from
Mar 11, 2024

Conversation

CermakM
Copy link
Collaborator

@CermakM CermakM commented Mar 9, 2024

This commit removes the ServerLogger interface and updates the recover and logging middlewares.

This commit removes the ServerLogger interface and updates the
recover and logging middlewares.

Signed-off-by: Marek Cermak <marek.cermak@strv.com>
@CermakM CermakM requested a review from a team March 9, 2024 08:26
Signed-off-by: Marek Cermak <marek.cermak@strv.com>
Signed-off-by: Marek Cermak <marek.cermak@strv.com>
@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2024

Codecov Report

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

Project coverage is 62.23%. Comparing base (da2103d) to head (13501ff).

Files Patch % Lines
http/middleware.go 0.00% 38 Missing ⚠️
internal/logger.go 60.00% 4 Missing ⚠️
internal/responsewriter.go 0.00% 3 Missing ⚠️
http/server.go 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #31      +/-   ##
==========================================
- Coverage   69.78%   62.23%   -7.55%     
==========================================
  Files           8       11       +3     
  Lines         546      617      +71     
==========================================
+ Hits          381      384       +3     
- Misses        153      221      +68     
  Partials       12       12              

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

Signed-off-by: Marek Cermak <marek.cermak@strv.com>
Copy link
Member

@robertrossmann robertrossmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM but after I got a taste of slog.LogValuer I feel strongly that it is The Right Way™ and I would love to see it adopted here as well. 🙏

http/middleware.go Outdated Show resolved Hide resolved
http/middleware.go Outdated Show resolved Hide resolved
http/middleware.go Show resolved Hide resolved
internal/logger.go Outdated Show resolved Hide resolved
http/server.go Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
README.md Show resolved Hide resolved
http/middleware.go Outdated Show resolved Hide resolved
http/middleware.go Outdated Show resolved Hide resolved
http/middleware.go Outdated Show resolved Hide resolved
This commit also removes the error and panic objects from the log data
and renames it to request data. The fields are then nested under a group
called "request" and as such, "request_" prefix was removed from the
fields.

Signed-off-by: Marek Cermak <marek.cermak@strv.com>
Signed-off-by: Marek Cermak <marek.cermak@strv.com>
Signed-off-by: Marek Cermak <marek.cermak@strv.com>
Signed-off-by: Marek Cermak <marek.cermak@strv.com>
Copy link
Member

@robertrossmann robertrossmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ :shipit:

@CermakM CermakM merged commit 6e8c0ef into master Mar 11, 2024
3 checks passed
@CermakM CermakM deleted the feat/migrate-to-slog branch March 11, 2024 15:20
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.

4 participants