Changeset 887
- Timestamp:
- 12/28/05 16:27:38
- Files:
-
- trunk/cherrypy/__init__.py (modified) (2 diffs)
- trunk/cherrypy/_cphttpserver.py (modified) (4 diffs)
- trunk/cherrypy/_cphttptools.py (modified) (1 diff)
- trunk/cherrypy/_cputil.py (modified) (1 diff)
- trunk/cherrypy/_cpwsgi.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r856 r887 82 82 return expose_ 83 83 84 def log(msg , context='', severity=0):84 def log(msg='', context='', severity=0, traceback=False): 85 85 """Syntactic sugar for writing to the (error) log.""" 86 86 # Load _cputil lazily to avoid circular references, and … … 88 88 import _cputil 89 89 logfunc = _cputil.get_special_attribute('_cp_log_message', '_cpLogMessage') 90 91 if traceback: 92 msg += _cputil.formatExc() 93 90 94 logfunc(msg, context, severity) 91 95 trunk/cherrypy/_cphttpserver.py
r884 r887 50 50 except httptools.MaxSizeExceeded: 51 51 self.send_error(413, "Request Entity Too Large") 52 tb = _cputil.formatExc() 53 cherrypy.log(tb) 52 cherrypy.log(traceback=True) 54 53 return False 55 54 else: … … 141 140 request.close() 142 141 except: 143 cherrypy.log( _cputil.formatExc())142 cherrypy.log(traceback=True) 144 143 raise ex 145 144 except: 146 tb = _cputil.formatExc()145 cherrypy.log(traceback=True) 147 146 try: 148 147 if request: 149 148 request.close() 150 149 except: 151 cherrypy.log( _cputil.formatExc())152 cherrypy.log(tb)150 cherrypy.log(traceback=True) 151 153 152 s, h, b = _cputil.bareError() 154 153 # CherryPy test suite expects bareError body to be output, … … 286 285 287 286 def handle_error(self, request, client_address): 288 cherrypy.log( _cputil.formatExc())287 cherrypy.log(traceback=True) 289 288 290 289 def serve_forever(self): … … 389 388 raise 390 389 except: 391 cherrypy.log( _cputil.formatExc())390 cherrypy.log(traceback=True) 392 391 finally: 393 392 request.close() trunk/cherrypy/_cphttptools.py
r886 r887 38 38 raise 39 39 except: 40 cherrypy.log( _cputil.formatExc())40 cherrypy.log(traceback=True) 41 41 42 42 def run(self, requestLine, headers, rfile): trunk/cherrypy/_cputil.py
r886 r887 356 356 if (not cherrypy.config.get('server.log_tracebacks', True) 357 357 and cherrypy.config.get('server.log_unhandled_tracebacks', True)): 358 cherrypy.log( formatExc())358 cherrypy.log(traceback=True) 359 359 360 360 cherrypy.HTTPError(500).set_response() trunk/cherrypy/_cpwsgi.py
r884 r887 102 102 request.close() 103 103 except: 104 cherrypy.log( _cputil.formatExc())104 cherrypy.log(traceback=True) 105 105 raise ex 106 106 except: 107 tb = _cputil.formatExc()107 cherrypy.log(traceback=True) 108 108 try: 109 109 if request: 110 110 request.close() 111 111 except: 112 cherrypy.log(_cputil.formatExc()) 113 cherrypy.log(tb) 112 cherrypy.log(traceback=True) 114 113 s, h, b = _cputil.bareError() 115 114 # CherryPy test suite expects bareError body to be output, … … 143 142 self.ready = False 144 143 145 tb = _cputil.formatExc() 146 cherrypy.log(tb) 144 cherrypy.log(traceback=True) 147 145 else: 148 146 if self.ready:

