http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11405
Revision: 11405 Author: drtrigon Date: 2013-04-21 10:55:57 +0000 (Sun, 21 Apr 2013) Log Message: ----------- bug fix; debugDump needs to invoke logoutput directly (because of currentframe)
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2013-04-21 10:29:21 UTC (rev 11404) +++ trunk/pywikipedia/wikipedia.py 2013-04-21 10:55:57 UTC (rev 11405) @@ -9389,7 +9389,7 @@ """Output a debug record to the log file.""" logoutput(text, decoder, newline, DEBUG, layer, **kwargs)
-def debugDump(name, site, error, data): +def debugDump(name, site, error, data, **kwargs): name = unicode(name) site = repr(site) data = pprint.pformat(data) @@ -9409,9 +9409,9 @@ except UnicodeDecodeError: f.write(data) f.close() - #debug( u'%s caused error %s. Dump %s created.' % (name,error,filename), - error( u'%s caused error %s. Dump %s created.' % (name,error,filename), - u'dump' ) + logoutput(u'%s caused error %s. Dump %s created.' % (name,error,filename), + # decoder=None, newline=True, _level=DEBUG, **kwargs) + decoder=None, newline=True, _level=ERROR, **kwargs)
# User input functions