Changes between Version 133 and Version 134 of DeveloperGuidelines/Tips


Ignore:
Timestamp:
06/12/14 10:59:47 (7 years ago)
Author:
Fran Boon
Comment:

Debugging Views, update other debug examples

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Tips

    v133 v134  
    1515curframe = inspect.currentframe()
    1616calframe = inspect.getouterframes(curframe, 2)
    17 #print 'caller name:', calframe[1][3]
    18 s3_debug('caller name:%s' % calframe[1][3])
     17current.log.debug("caller name: %s" % calframe[1][3])
    1918}}}
    2019 * Debug SQL Queries:
     
    2524        def response(sql):
    2625            if "searchphrase" in sql:
    27                 print >> sys.stderr, "Query: %s" % query
    28                 print >> sys.stderr, "SQL: %s" % sql
     26                current.log.debug("Query: %s" % query)
     27                current.log.debug("SQL: %s" % sql)
     28}}}
     29 * Debug Views:
     30{{{
     31vi gluon/globals.py
     32    def write(self, data, escape=True):
     33        try:
     34            ...All Old Code ...
     35        except Exception, error:
     36            # Put Eclipse breakpoint on the below line
     37            exc_type, exc_value, exc_traceback = sys.exc_info()
     38            pass
    2939}}}
    3040* [http://aymanh.com/python-debugging-techniques Python Debugging Techniques]