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
145 stars 20 forks source link

unable to configure handler 'file' #31

Closed codilau closed 1 year ago

codilau commented 1 year ago

Hey @iSarabjitDhiman, since you move so swiftly, here's a new one for you. This might not affect everybody and might even be related to my system, I can't be sure. You changed a bit your logger system in the latest versions as this wasn't an issue before - at least in 0.0.10 the implementation was a lot simpler.

Here's part of the trace:

File ".../python3.10/site-packages/tweeterpy/util.py", line 10, in <module>
  logging.config.dictConfig(config.LOGGING_CONFIG)
File "/usr/lib/python3.10/logging/config.py", line 811, in dictConfig
  dictConfigClass(config).configure()
File "/usr/lib/python3.10/logging/config.py", line 572, in configure
  raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'file'

I tried disabling the logging but it changes nothing, also tried specifying the file as None.

iSarabjitDhiman commented 1 year ago

Hey @iSarabjitDhiman, since you move so swiftly, here's a new one for you. This might not affect everybody and might even be related to my system, I can't be sure. You changed a bit your logger system in the latest versions as this wasn't an issue before - at least in 0.0.10 the implementation was a lot simpler.

Here's part of the trace:

File ".../python3.10/site-packages/tweeterpy/util.py", line 10, in <module>
  logging.config.dictConfig(config.LOGGING_CONFIG)
File "/usr/lib/python3.10/logging/config.py", line 811, in dictConfig
  dictConfigClass(config).configure()
File "/usr/lib/python3.10/logging/config.py", line 572, in configure
  raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'file'

I tried disabling the logging but it changes nothing, also tried specifying the file as None.

Hey You cannot set the LOG_FILE_NAME to None. It has to be "something.log". If you want to disable the file logs just remove from the logging handlers in LOGGING_CONFIG dict here There should be a list of two handlers in LOGGING_CONFIG in loggers i.e. stream, file. Just remove the 'file' from both root loggers and __main__ loggers.

If you want to disable all the logs just set DISABLE_LOGS = True Set DISABLE_EXTERNAL_LOGS = True if you want to disable the logs from imported modules.

Also let me know when do u get this error? Are you trying to configure something or it occurs when you are using some specific function?

codilau commented 1 year ago

I'll close this since it might be some quirk affecting one of my venvs, certainly it's not a general issue, and since the solution of disabling log files is good enough for me and others that might encounter this. Thanks again