-
Notifications
You must be signed in to change notification settings - Fork 84
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
Remove logging from function and structs. #582
Conversation
44ee56b
to
a1f178f
Compare
Changes Unknown when pulling 0521d0e on shawn-hurley:logging-impl into ** on openshift:master**. |
Changes Unknown when pulling 0521d0e on shawn-hurley:logging-impl into ** on openshift:master**. |
pkg/apb/types.go
Outdated
"github.com/openshift/ansible-service-broker/pkg/config" | ||
utillogging "github.com/openshift/ansible-service-broker/pkg/util/logging" |
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.
After reading it a few times, how about 'logutilinstead of
utillogging`? :)
pkg/app/app.go
Outdated
fmt.Printf("%#v", app.config) | ||
|
||
if app.log, err = NewLog(app.config); err != nil { | ||
c := utillogging.LogConfig{ |
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.
logutil instead of utillogging
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.
looks great. On minor nit is rename utillogging to logutil unless of course goimports picked the name for you then it's probably ok.
pkg/util/logging/logger.go
Outdated
|
||
//InitilizeLog - initilize the logging utility |
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.
space after the //
pkg/util/logging/logger.go
Outdated
|
||
//InitilizeLog - initilize the logging utility | ||
func InitilizeLog(config LogConfig) 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.
TYPO: InitilizeLog -> InitializeLog
pkg/auth/auth.go
Outdated
) | ||
|
||
var log = utillogging.NewLog() |
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.
Ah so each package does this call. I was searching for where the hell the logger was set. Found it.
@@ -22,7 +22,6 @@ import ( | |||
"os" | |||
|
|||
logging "github.com/op/go-logging" | |||
"github.com/openshift/ansible-service-broker/pkg/config" | |||
) |
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.
The package of this file is package app
yet it lives in util/logging
which is the right package?
Changes Unknown when pulling a2de11a on shawn-hurley:logging-impl into ** on openshift:master**. |
a2de11a
to
c91f124
Compare
Changes Unknown when pulling c91f124 on shawn-hurley:logging-impl into ** on openshift:master**. |
c91f124
to
fef1f08
Compare
Changes Unknown when pulling fef1f08 on shawn-hurley:logging-impl into ** on openshift:master**. |
Changes Unknown when pulling e3fcf9a on shawn-hurley:logging-impl into ** on openshift:master**. |
👍 pending Zeus' comment |
Changes Unknown when pulling e1c4862 on shawn-hurley:logging-impl into ** on openshift:master**. |
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.
Swore I reviewed this but I must have never submitted or something. Really happy to see the logs removed from the credentials.
Something feels weird about package level globals to me but I know it's a pretty standard go pattern.
e1c4862
to
98011cd
Compare
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
parameters *Parameters, | ||
log *logging.Logger, | ||
) (string, *ExtractedCredentials, error) { | ||
func Bind(instance *ServiceInstance, |
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.
Gross 😃
Changes Unknown when pulling df55e45 on shawn-hurley:logging-impl into ** on openshift:master**. |
* logging changes to remove logging from function and structs. * fixing the testing of logging. * adding test cases and addressing comments. * fixing lines that should be broken due to length
Describe what this PR does and why we need it:
Removes logging from the function signatures and structures
Changes proposed in this pull request
log
var to each package that needs it that is package accessible.Most of the fixes are in util/logging/logger.go. All the other changes are setting up the logger per package and removing the log from structures and functions
Which issue this PR fixes (This will close that issue when PR gets merged)
fixes #270