Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add logger to config. #16

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 6 commits into from
Jan 28, 2021
Merged

Add logger to config. #16

merged 6 commits into from
Jan 28, 2021

Conversation

onrik
Copy link
Contributor

@onrik onrik commented Jan 25, 2021

Closes #11

@fergusstrange
Copy link
Owner

Hey @onrik this looks great.

As part of this PR could you add the config directive to the documentation table and examples in the README.md and also add the custom config line to the func Test_CustomConfig(t *testing.T) perhaps with ioutil.Discard. This should help bump coverage which has currently dropped a little.

It might also be worth highlighting that using ioutil.Discard is the easiest way to turn off logging in the README.md as well.

All in all great stuff though and ready to merge when these changes are in! 👏

@onrik
Copy link
Contributor Author

onrik commented Jan 27, 2021

With ioutil.Discard tests still failed :(

@fergusstrange
Copy link
Owner

Hey @onrik my apologies it turns out there are some issues with using Discard. The recommended approach is actually to use Logger(nil) according to exec.Command.

This was being hidden behind some bad code in shutdownDBAndFail which I've updated.

Suggest that we update to a convenience method called Silent or something akin in order to wrap up the Logger(nil) call. Then just a matter of updating docs to reflect this and we're good to go!

Apologies again for the bad advice!

Copy link
Owner

@fergusstrange fergusstrange left a comment

Choose a reason for hiding this comment

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

Preference would be to add a convenience method but we can have a look at that as a next step.

Great work and merging now!

@fergusstrange fergusstrange merged commit c7d9cea into fergusstrange:master Jan 28, 2021
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.

Add custom logger for postgres output
2 participants