Skip to content

Add the logger to the user struct to pass around #71

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

Merged
merged 2 commits into from
Jul 6, 2020

Conversation

chrisgilmerproj
Copy link

@chrisgilmerproj chrisgilmerproj commented Jul 6, 2020

I'm not sure why I didn't think of this in my logging PR. By passing logger as part of the User struct we eliminate the need to pass a logger around via functions calls. This really simplifies the code and makes it easier to read.

Also, the more I consider it the User struct is really just the configuration for the setup function. When I think of it in that context then the Logger doesn't feel out of place in the struct. So in a future PR we might want to rename User to SetupConfig.

…d to pass a logger around via functions calls
@chrisgilmerproj chrisgilmerproj requested a review from a team July 6, 2020 17:41
@chrisgilmerproj chrisgilmerproj self-assigned this Jul 6, 2020
Copy link
Contributor

@eeeady eeeady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little confusing if you leave it as a struct called User but I agree that it's more readable and since you plan on renaming it I'm on board.

@chrisgilmerproj
Copy link
Author

It's a little confusing if you leave it as a struct called User but I agree that it's more readable and since you plan on renaming it I'm on board.

I may just make a PR to do the renaming soon. I want to make sure some of these structural changes are done separately from #67.

@chrisgilmerproj chrisgilmerproj merged commit 59700fc into master Jul 6, 2020
@chrisgilmerproj chrisgilmerproj deleted the cg_pass_logger branch July 6, 2020 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants