-
Notifications
You must be signed in to change notification settings - Fork 51
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
refactor: Remove extra log levels #634
refactor: Remove extra log levels #634
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #634 +/- ##
===========================================
- Coverage 57.00% 56.96% -0.05%
===========================================
Files 122 122
Lines 14661 14646 -15
===========================================
- Hits 8358 8343 -15
Misses 5588 5588
Partials 715 715
|
It'd be be nice to communicate to zap the exact levels we're using, instead of it internally using its default 7, but I could only find a way to add more levels |
@@ -462,7 +462,7 @@ func stopGRPCServer(ctx context.Context, server *grpc.Server) { | |||
select { | |||
case <-timer.C: | |||
server.Stop() | |||
log.Warn(ctx, "Peer gRPC server was shutdown ungracefully") | |||
log.Info(ctx, "Peer gRPC server was shutdown ungracefully") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like an Error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this is not an error. An error is something that needs to be handled by the caller. This is just a message sent back to the console/logs to let the user know that something happened. Hence it's just Information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to prepend something like "Warning" on some of the Info messages? I'm towards yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to prepend something like "Warning" on some of the Info messages? I'm towards yes.
🤣 Please dont do this lol. If someone really wants it to be a warning then they should use/re-introduce it as a log level (I dont think they should lol, but it is better than doing this)
A) needs to remove in config as well: Line 359 in eab50ad
B) why remove C) other instances ... Line 96 in eab50ad
Line 150 in eab50ad
Line 85 in eab50ad
D) should this be modified as well? Line 56 in eab50ad
along with defradb/logging/logging_test.go Line 207 in eab50ad
|
A, C and D yes. Didn't think about those. B, FeedbackDebug makes no sense to me. Debug is a message for Defra devs. Hence the logs will not be sent to file if we are doing development. And even if they are, we're looking at them. Feedback is for users. Not Devra devs. |
Does it matter though? We are pretty much doing that by only exposing the log levels we want. |
With that zap would do slightly less internal work, but it doesn't matter too much, and it a quick look into it led me to guess that lowering levels is not possible with zap anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - cheers Fred
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved conditional on A, C and D discussed above being fixed.
Relevant issue(s) Resolves sourcenetwork#612 Description This PR removes Warn, FeedbackWarn and FeedbackDebug. It was initially going to remove Fatal and FatalE as well but other out of scope changes need to be done prior to considering this. Keeping just this minor reduction for now and will revisit for v0.3.1.
Relevant issue(s)
Resolves #612
Description
This PR removes
Warn
,FeedbackWarn
andFeedbackDebug
. It was initially going to removeFatal
andFatalE
as well but other out of scope changes need to be done prior to considering this.Keeping just this minor reduction for now and will revisit for v0.3.1.
Tasks
How has this been tested?
Unit testing
Specify the platform(s) on which this was tested: