How to enable .debug in WebRequestManager? #25

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

Projects

None yet

2 participants

@inactivist

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

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

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

@lucjon
Owner

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

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