Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
replacing logrus with slog v1 #2010
base: main
Are you sure you want to change the base?
replacing logrus with slog v1 #2010
Changes from 1 commit
1b6f4d6
bd63c16
647228e
366bc6e
b5d0a06
e81aa10
28340f3
e765552
ba79569
f0bf927
5039841
f22cc6c
4859555
f9b398f
01b47be
d48ecdf
e2f532c
0b291b0
caf4ea3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We should keep this interface exactly the same and just implement it in terms of slog, why create all of the new methods above if they were not being used?
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.
Even if I remove the rest, I will have to keep them in a separate interface and take those interfaces in entry since if I write all functions inside entry, the linter in the pipeline gives error for interfacebloat
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.
As for the extra methods, I can remove those but the problem for logrus vs slog levels and problems in Severity due to this still remains
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.
I'm not sure how they still remain, all you need to do is create a separate file that implements Entry in terms of log/slog?
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.
Here's an example:
For severity in the
errors
package, you can continue to use logrus levels, or you can change it to slog, or better yet create an abstraction in the athens log package because the error package shouldn't import a third party libThere 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.
An abstraction is preferred, imo.
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.
ok, got the abstraction part but still a bit confused, so you mean to say that i should only have the function declarations in entry and then implement those in log.go like it was done before my changes for SystemErr implementation or like for WithFields implementation?
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.
??
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.
I mean that you keep the interface exactly the same and just create a log/slog v1 implementation of that interface (in a separate file, within the same package). Therefore, nothing changes outside of the log package (and the errors/severity, due to the abstraction we talked about above)