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

debug(False) enables debug #1802

Closed
Paso opened this issue Feb 3, 2022 · 2 comments
Closed

debug(False) enables debug #1802

Paso opened this issue Feb 3, 2022 · 2 comments
Labels
Bug This is regarding a bug with the library

Comments

@Paso
Copy link

Paso commented Feb 3, 2022

tweepy.debug in tweepy/__init__.py ignores its enable argument which makes statements such as tweepy.debug(args.VERBOSE >= 2) not work as expected

@Harmon758
Copy link
Member

This is a legacy function back from when the library directly used httplib.
Its enable parameter has actually been ignored since it was added.
Since it's undocumented and serves little purpose (You can easily set http.client.HTTPConnection.debuglevel yourself), I'll be removing it in the next release. Thanks for pointing it out.

Tweepy and its dependencies use logging, so to control logging, you can instead use logging.basicConfig or use logging.getLogger to configure the logger for each library individually.

@Harmon758 Harmon758 added the Bug This is regarding a bug with the library label Feb 3, 2022
@Harmon758
Copy link
Member

Resolved with a702325, where I've removed the debug function,
I've also added documentation for logging with 7701506. I opted not to include any mention of http.client.HTTPConnection.debuglevel, as it's constrained to only printing to the console and it doesn't seem to be explicitly documented in Python's documentation for the http.client module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is regarding a bug with the library
Projects
None yet
Development

No branches or pull requests

2 participants