iSarabjitDhiman / TweeterPy

TweeterPy is a python library to extract data from Twitter. TweeterPy API lets you scrape data from a user's profile like username, userid, bio, followers/followings list, profile media, tweets, etc.
MIT License
123 stars 17 forks source link

Is there a way to set the logging level? #39

Closed nballen-tx closed 6 months ago

nballen-tx commented 9 months ago

It feels like there is just too much log information.

e.g.

2023-10-22 20:29:56,401 [ERROR] :: Couldn't get the API file Url. 'NoneType' object has no attribute 'group' Traceback (most recent call last): File "/opt/conda/lib/python3.9/site-packages/tweeterpy/api_util.py", line 68, in _get_api_file_url api_file_name = re.search(api_file_regex, page_source).group(1) AttributeError: 'NoneType' object has no attribute 'group' 2023-10-22 20:29:59,104 [INFO] :: API Updated Successfully. 2023-10-22 20:29:59,105 [INFO] :: User is authenticated. 2023-10-22 20:29:59,254 [INFO] :: User is authenticated.

Is there a way to not display these?

For example, all logs, important logs, no logs.

Thanks,

iSarabjitDhiman commented 9 months ago

It feels like there is just too much log information.

e.g.

2023-10-22 20:29:56,401 [ERROR] :: Couldn't get the API file Url. 'NoneType' object has no attribute 'group' Traceback (most recent call last): File "/opt/conda/lib/python3.9/site-packages/tweeterpy/api_util.py", line 68, in _get_api_file_url api_file_name = re.search(api_file_regex, page_source).group(1) AttributeError: 'NoneType' object has no attribute 'group' 2023-10-22 20:29:59,104 [INFO] :: API Updated Successfully. 2023-10-22 20:29:59,105 [INFO] :: User is authenticated. 2023-10-22 20:29:59,254 [INFO] :: User is authenticated.

Is there a way to not display these?

For example, all logs, important logs, no logs.

Thanks,

Yes, you can set the logging levels. Check the docs here : https://github.com/iSarabjitDhiman/TweeterPy/blob/master/docs/config.md#logs

You can also disable the logs completely if you want.

Feel free to close the issue if you have no more questions.