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

How to enable .debug in WebRequestManager? #25

Open
inactivist opened this issue Mar 31, 2013 · 4 comments
Open

How to enable .debug in WebRequestManager? #25

inactivist opened this issue Mar 31, 2013 · 4 comments

Comments

@inactivist
Copy link

WebRequestManager has a debug field, which is initialized to False. I see no way to set it == True sans code hacking or class attribute manipulation. Have I missed something?

@inactivist
Copy link
Author

This seems to work:

import stackexchange
so = stackexchange.Site(stackexchange.StackOverflow)
stackexchange.web.WebRequestManager.debug = True

... do some stackexchange things here...

-- but requires code diving as it's not part of any published interface -- and operates globally across all API requests.

@inactivist
Copy link
Author

I've added a FAQ entry suggesting the technique shown above.

@lucjon
Copy link
Owner

lucjon commented Mar 31, 2013

Thanks a lot; that is indeed the way I have usually enabled it, or through similar code in a REPL session.

I hadn't previously considered it as useful for anything but library debugging, but I suppose it could also be useful for application debugging. Per #24 you opened, I think you are right in that it should be migrated to use the logging module, probably with a logger instance per site.

@inactivist
Copy link
Author

It all depends on your roadmap -- as far as I'm concerned, if I expect to use this in a server environment as part of a real app, I'll want proper, configurable logging facilities.

You're the architect, so I'll let you take the lead (especially on #24) but once that starts, I'll jump in as appropriate.

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