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

faker spamming the logs #753

Closed
jaraco opened this Issue May 12, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@jaraco
Copy link

jaraco commented May 12, 2018

I use faker in a short running script. Starting apparently with 0.8.14, every time I initialize the faker, I see this in the logs:

INFO:faker.factory:Provider `faker.providers.address` has been localized to `en_US`.
INFO:faker.factory:Provider `faker.providers.automotive` has been localized to `en_US`.
WARNING:faker.factory:Specified locale `en_US` is not available for provider `faker.providers.bank`. Locale reset to `en_GB` for this provider.
INFO:faker.factory:Provider `faker.providers.barcode` does not feature localization. Specified locale `en_US` is not utilized for this provider.
INFO:faker.factory:Provider `faker.providers.color` has been localized to `en_US`.
INFO:faker.factory:Provider `faker.providers.company` has been localized to `en_US`.
INFO:faker.factory:Provider `faker.providers.credit_card` does not feature localization. Specified locale `en_US` is not utilized for this provider.
INFO:faker.factory:Provider `faker.providers.currency` does not feature localization. Specified locale `en_US` is not utilized for this provider.
INFO:faker.factory:Provider `faker.providers.date_time` has been localized to `en_US`.
INFO:faker.factory:Provider `faker.providers.file` does not feature localization. Specified locale `en_US` is not utilized for this provider.
INFO:faker.factory:Provider `faker.providers.internet` has been localized to `en_US`.
INFO:faker.factory:Provider `faker.providers.isbn` does not feature localization. Specified locale `en_US` is not utilized for this provider.
INFO:faker.factory:Provider `faker.providers.job` has been localized to `en_US`.
INFO:faker.factory:Provider `faker.providers.lorem` has been localized to `en_US`.
INFO:faker.factory:Provider `faker.providers.misc` does not feature localization. Specified locale `en_US` is not utilized for this provider.
INFO:faker.factory:Provider `faker.providers.person` has been localized to `en_US`.
INFO:faker.factory:Provider `faker.providers.phone_number` has been localized to `en_US`.
INFO:faker.factory:Provider `faker.providers.profile` does not feature localization. Specified locale `en_US` is not utilized for this provider.
INFO:faker.factory:Provider `faker.providers.python` does not feature localization. Specified locale `en_US` is not utilized for this provider.
INFO:faker.factory:Provider `faker.providers.ssn` has been localized to `en_US`.
INFO:faker.factory:Provider `faker.providers.user_agent` does not feature localization. Specified locale `en_US` is not utilized for this provider.

I expect two things differently:

  1. The logging at the info level should provide useful information. These info messages should probably be at the DEBUG level or so... since it's not particularly useful information except in debugging.
  2. Since the default locale is en_US, all providers provided by the package should implement the default locale. In other words, the most basic usage of the library shouldn't be emitting warnings.

For now, I'm disabling these logs with logging.getLogger('faker.factory').setLevel(logging.ERROR). It feels a bit fragile to have to key on faker.factory. Can you provide a better recommendation?

@fcurella

This comment has been minimized.

Copy link
Collaborator

fcurella commented May 14, 2018

It should be lowered to DEBUG. Feel free to submit a PR, and I'll merge it and release.

@fcurella

This comment has been minimized.

Copy link
Collaborator

fcurella commented May 14, 2018

I've just released v0.8.15 with all logging statements set to DEBUG

@fcurella fcurella closed this May 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.