question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

faker spamming the logs

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:12

github_iconTop GitHub Comments

27reactions
fcurellacommented, May 10, 2019

@DataGreed if you set logging.getLogger('faker').setLevel(logging.ERROR), it should mute all logging from faker

7reactions
fcurellacommented, May 14, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Faker is spamming VI mid again. : r/ViMains - Reddit
20 votes, 11 comments. 14K subscribers in the ViMains community. A subreddit for all Vi mains from League of Legends.
Read more >
Thorin on Twitter: "If you've watched Faker's Pro View then you ...
If you've watched Faker's Pro View then you'll now realise how utterly stupid ... on the topic of the benefits of spamming F...
Read more >
Quiet down 'faker' in pytests - Reinout van Rees
Problem I'm having is that, when running the tests with pytest, pytest helpfully reports all the logging when something goes wrong. Only, tests ......
Read more >
Dev corrupts NPM libs 'colors' and 'faker' breaking thousands ...
Open Source Revolution? The developer behind popular open-source NPM libraries 'colors' (aka colors.js on GitHub) and 'faker' (aka faker.
Read more >
SKT Faker - You need to spam mastery emote to show...
SKT Faker is on Facebook. To connect with SKT Faker, join Facebook today. Join. or. Log In.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found