Skip to content
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

Silence logger #84

Closed
soanvig opened this issue Aug 20, 2019 · 4 comments · Fixed by #86
Closed

Silence logger #84

soanvig opened this issue Aug 20, 2019 · 4 comments · Fixed by #86
Labels
area/cli Refers to Mongo Seeding CLI area/core Refers to Mongo Seeding library 🚀 enhancement New feature or request
Milestone

Comments

@soanvig
Copy link

soanvig commented Aug 20, 2019

Hello!

We are using this library in company, mostly for seeding database before each test. It works great, but the logging is terrible feature for us. It may be useful for one-time seeding, but since every our test generates such logs, our log from testing is bloated.

Could you please either implement logging silence, or point out how it should be properly done, so I can prepare PR? I looked into the code and I have at least few ideas how to configure logger (since it's just a sample function now), so we could discuss that perhaps

@pkosiec
Copy link
Owner

pkosiec commented Aug 20, 2019

Hello @soanvig, which Mongo Seeding type do you use?

In case of Core (TS library):
The logging should be disabled by default. You can see how to configure it here: https://github.com/pkosiec/mongo-seeding/tree/master/core#debug-output

In case of CLI, I can see that indeed there is no option to do so. I will implement --silent flag soon. Stay tuned!

@pkosiec pkosiec added area/cli Refers to Mongo Seeding CLI 🚀 enhancement New feature or request labels Aug 20, 2019
@pkosiec
Copy link
Owner

pkosiec commented Aug 20, 2019

BTW, in the meantime, you can pipe the logs to /dev/null. Like:

seed ./ > /dev/null

@pkosiec pkosiec added this to the 3.4.0 milestone Aug 20, 2019
@soanvig
Copy link
Author

soanvig commented Aug 20, 2019

Thank you, we use library, but still get logs.

Gonna see tomorrow what sits there precisely, maybe something is poorly configured on our side.

@pkosiec
Copy link
Owner

pkosiec commented Aug 20, 2019

@soanvig Okay, I've just checked an example from this repository and without setting DEBUG env there is no logs in stdout, apart from DeprecationWarning related to MongoDB update (EDIT: which is already fixed) . So looks like it is a wrong configuration indeed. However, this is still an issue for CLI, so thanks for good suggestion.

@pkosiec pkosiec added the area/core Refers to Mongo Seeding library label Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Refers to Mongo Seeding CLI area/core Refers to Mongo Seeding library 🚀 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants