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

Use more slog, replacing logrus #150

Merged
merged 2 commits into from
Oct 6, 2023
Merged

Use more slog, replacing logrus #150

merged 2 commits into from
Oct 6, 2023

Conversation

norkans7
Copy link
Collaborator

@norkans7 norkans7 commented Oct 6, 2023

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2023

Codecov Report

Merging #150 (c3fafb7) into main (cdda626) will decrease coverage by 0.02%.
The diff coverage is 21.73%.

@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
- Coverage   62.56%   62.55%   -0.02%     
==========================================
  Files         147      147              
  Lines       12324    12317       -7     
==========================================
- Hits         7711     7705       -6     
+ Misses       3779     3778       -1     
  Partials      834      834              
Files Coverage Δ
services/tickets/zendesk/web.go 66.03% <100.00%> (ø)
services/ivr/twiml/service.go 29.75% <0.00%> (ø)
web/middleware.go 71.42% <66.66%> (-5.05%) ⬇️
web/ivr/ivr.go 43.91% <0.00%> (+0.23%) ⬆️
services/ivr/vonage/service.go 30.23% <16.66%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@norkans7 norkans7 requested a review from rowanseymour October 6, 2023 14:40
@@ -14,6 +14,8 @@ import (
"strconv"
"strings"

"log/slog"
Copy link
Member

Choose a reason for hiding this comment

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

put with other std lib deps

@@ -18,6 +18,8 @@ import (
"strings"
"time"

"log/slog"
Copy link
Member

Choose a reason for hiding this comment

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

as above

@@ -47,7 +42,7 @@ func panicRecovery(next http.Handler) http.Handler {
defer func() {
if rvr := recover(); rvr != nil {
debug.PrintStack()
log.WithError(errors.New(fmt.Sprint(rvr))).Error("recovered from panic in web handling")
slog.Error("recovered from panic in web handling", "error", errors.New(fmt.Sprint(rvr)))
Copy link
Member

Choose a reason for hiding this comment

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

I don't think errors.New(..) is needed here since it's just going to log as a string...

@norkans7 norkans7 requested a review from rowanseymour October 6, 2023 15:06
@rowanseymour rowanseymour merged commit 5efe8db into main Oct 6, 2023
@rowanseymour rowanseymour deleted the more-slog branch October 6, 2023 16:23
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants