-
Notifications
You must be signed in to change notification settings - Fork 152
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
Initial structure of log repo #272
Conversation
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.
Almost there!
pkg/log/log.go
Outdated
type logLevel string | ||
|
||
const ( | ||
logTypeInfo logLevel = "Info" |
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.
Rather than use string literals, please use the constants from logrus
) | ||
|
||
type logger struct { | ||
level 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.
We can revise the implementation later. For now, this interface helps modifying / adding the call points.
@julio-lopez I did not commit your suggestions directly since I wanted to make some more changes. Pushed a PR with your suggestions, Ready for another review! |
pkg/log/log.go
Outdated
@@ -47,22 +47,24 @@ func WithContext(ctx context.Context) { | |||
} | |||
|
|||
func (l *logger) Print(msg string) { | |||
var message interface{} |
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.
Is this needed?
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 was failing before with: pkg/log/log.go:52:14: cannot use msg (type string) as type []interface {} in argument to logrus.Info
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.
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.
Oh I think I know where I went wrong! pushing an updated PR.
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.
Sorry for the confusion @julio-lopez, I was calling logrus.Info(msg...)
instead if logrus.Info(msg)
. Fixing it now
Change Overview
Make logs more descriptive and easy to use & read
This task will be divided in small PRs and merged
This PR is the initial structure of the log repo
Pull request type
Please check the type of change your PR introduces: