-
Notifications
You must be signed in to change notification settings - Fork 508
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
⚠️ log: Initial logr
/logrusr
implementation
#1516
Conversation
Integration tests success for |
Integration tests success for |
ab7c620
to
b8fd952
Compare
Integration tests success for |
Codecov Report
@@ Coverage Diff @@
## main #1516 +/- ##
==========================================
+ Coverage 51.25% 51.32% +0.07%
==========================================
Files 68 68
Lines 6140 6131 -9
==========================================
Hits 3147 3147
+ Misses 2788 2779 -9
Partials 205 205 |
If we merge this change then the next release would have to be |
b8fd952
to
3ab622a
Compare
Integration tests success for |
3ab622a
to
af4b787
Compare
Integration tests success for |
af4b787
to
f85ee75
Compare
@naveensrinivasan @azeemshaikh38 -- I think this is ready for review! |
logr
/logrusr
implementationlogr
/logrusr
implementation
Integration tests success for |
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.
This is so much neater, thanks @justaugustus!
go.mod
Outdated
@@ -35,6 +37,8 @@ require ( | |||
mvdan.cc/sh/v3 v3.4.2 | |||
) | |||
|
|||
// TODO(go.mod): Is there a reason these deps are kept separately from the |
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.
@naveensrinivasan might know why?
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.
It looks like they might be related to tools, which is why they got segmented off?
Anyhow, I kept the TODO in and moved them to the top in bba907d, which should cause go mod tidy
to update the larger replace
block instead.
True. For now, I think we can merge this in and discuss in this week's meet about how to handle the release version. |
Signed-off-by: Stephen Augustus <[email protected]>
Signed-off-by: Stephen Augustus <[email protected]>
...to prevent automatic updates from getting added to the smaller section. Signed-off-by: Stephen Augustus <[email protected]>
f85ee75
to
bba907d
Compare
@azeemshaikh38 -- Happy to help! I just rebased to deconflict w/ |
Integration tests success for |
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.
Thanks!
// If the level is not recognized, it defaults to `logrus.InfoLevel` to swallow | ||
// potential configuration errors/typos when specifying log levels. | ||
// https://pkg.go.dev/github.com/sirupsen/logrus#ParseLevel | ||
func ParseLevel(lvl string) logrus.Level { |
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.
Could we add some unit tests for this?
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.
Could we add some unit tests for this?
Created #1528 for tracking!
log
package #1528Continues #1502.
ref: #1273
Signed-off-by: Stephen Augustus [email protected]
#1502 implemented a generic logger that wrapped
zap
. Create a new logger is done by callinglog.Logger(log.Level)
.log.Logger
now useslogr
, which provides a sane interface and has multiple popular implementations.From @thockin in #1273 (comment):
While
zapr
exists, I opted to chooselogrusr
aslogrus
just happens to be used by a few more projects in the ecosystem that I'm familiar with (including Kubernetes Release Engineering logging)Yes!
Consumers of functions like:
will need to use
log.Logger
as an argument:as well as update log calls from:
to: