How to enable .debug in WebRequestManager? #25

inactivist opened this Issue Mar 31, 2013 · 4 comments


None yet

2 participants


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?


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.


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


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.


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