-
Notifications
You must be signed in to change notification settings - Fork 1
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
Restructure project #10
base: master
Are you sure you want to change the base?
Conversation
log/log.go
Outdated
} | ||
|
||
func newLogrusLogger(cfg config.Provider) *logrus.Logger { | ||
|
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.
Remove extra space
log/log.go
Outdated
} | ||
|
||
func NewLogger(cfg config.Provider) *Logger { | ||
return newLogrusLogger(cfg) |
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.
Anything calls newLogrusLogger? Make it simpler just inline the method
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.
Line 18. This function is created to generate a new logger.
Developer can simply import github.com/hyperpilotio/ingestor/log
and use those function ( ex: log.Info ) directly because the init
function has been executed. If they want to have a new logger for some purposes, they can call log.NewLogger
to get a new logger.
https://github.com/Hyperpilotio/ingestor/pull/10/files#diff-fbf850c1cb9fc6234051c4e9517a5274R18
version.go
Outdated
var GitCommit string | ||
|
||
// The main version number that is being run at the moment. | ||
const Version = "0.1.0" |
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.
Where is this 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.
Makefile
VERSION := $(shell grep "const Version " version.go | sed -E 's/.*"(.+)"$$/\1/')
docker build --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=$(GIT_COMMIT) -t $(IMAGE_NAME):local .
...
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.
hmm, seems quite hacky for me to grep a file for a version.
I rather make it simple for now and just remove this so we don't end up having to maintain this when we never needed it. Git commit makes a lot more sense for me.
After these fixed we can merge |
fc2b677
to
0c19b2f
Compare
WHY / WHAT
Instead of passing configuration object into each function. Initializing the configuration object in config/config.go. Those function which requires configuration can import
github.com/hyperpilotio/ingestor/config
and the function would be able to use the configuration object.