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

2.0.8 way too verbose #145

Closed
fenchu opened this issue Nov 25, 2021 · 3 comments
Closed

2.0.8 way too verbose #145

fenchu opened this issue Nov 25, 2021 · 3 comments

Comments

@fenchu
Copy link

fenchu commented Nov 25, 2021

>>> import requests
>>> requests.__version__
'2.26.0'
>>> import charset_normalizer
>>> charset_normalizer.__version__
'2.0.8'

windows10, ubuntu 20.04 lts

I need to set this in all files just to get rid of it:

logging.getLogger('charset_normalizer').setLevel(logging.FATAL)

the first and the last are mine, in the middle just hyper verbose, definetely not info, not even debug.

20211125112541|INFO|operator users:{'username': '15918697710', 'phone': '+4799113717', 'personstatus': 'bosatt', 'fornavn': 'VIS', 'mellomnavn': None, 'etternavn': 'FORDYPNING'}

20211125112541|WARNING|override steps (5) and chunk_size (512) as content does not fit (465 byte(s) given) parameters.
20211125112541|INFO|ascii passed initial chaos probing. Mean measured chaos is 0.000000 %
20211125112541|INFO|ascii should target any language(s) of ['Latin Based']
20211125112541|INFO|We detected language [('English', 1.0), ('Dutch', 1.0), ('Indonesian', 1.0)] using ascii
20211125112541|INFO|ascii is most likely the one. Stopping the process.
20211125112541|WARNING|override steps (5) and chunk_size (512) as content does not fit (465 byte(s) given) parameters.
20211125112541|INFO|ascii passed initial chaos probing. Mean measured chaos is 0.000000 %
20211125112541|INFO|ascii should target any language(s) of ['Latin Based']
20211125112541|INFO|We detected language [('English', 1.0), ('Dutch', 1.0), ('Indonesian', 1.0)] using ascii
20211125112541|INFO|ascii is most likely the one. Stopping the process.

20211125112541|INFO|added mobile: {'result': 0, 'description': 'success', 'dn': '', 'message': '', 'referrals': None, 'type': 'modifyResponse'}

@fenchu fenchu added bug Something isn't working help wanted Extra attention is needed labels Nov 25, 2021
@fenchu
Copy link
Author

fenchu commented Nov 25, 2021

I do not use this package it is all from requests.py,

@Ousret
Copy link
Collaborator

Ousret commented Nov 25, 2021

While I understand your concern, I do not share it.
It is not a bug but rather a change request.

What I understand from your ticket is:

  • You set up a custom handler for n lib
  • You dislike the amount of generated entries given by charset_normalizer
  • You manually changed the verbosity level to silent it

What happens to you is that your server does not give an explicit charset to decode the text/payload/JSON and requests will use this library to 'guess' the actual encoding.

Maybe I misunderstood your point, but the entries nor the levels applied changed between minor.

@Ousret Ousret closed this as completed Nov 25, 2021
@Ousret Ousret removed bug Something isn't working help wanted Extra attention is needed labels Nov 25, 2021
@Ousret Ousret changed the title [BUG] 2.0.8 way too verbose 2.0.8 way too verbose Nov 25, 2021
@fenchu
Copy link
Author

fenchu commented Nov 26, 2021

I set explicitly "Content-Type: application/json; charset=utf-8" in all headers or downgrade to requests v 2.25.1 to fix this.

But I really do not see any need for guessing the encoding, just crash if it fails, But this is a issue for requests.py team

thanks

Ousret added a commit that referenced this issue Jan 29, 2022
Ousret added a commit that referenced this issue Jan 29, 2022
* 🔧 The logging behavior have been completely reviewed, now using only TRACE and DEBUG levels

Following #162 and #145 and #134
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

No branches or pull requests

2 participants