Skip to content

Commit

Permalink
Merge pull request ipython#2818 from minrk/log_exception
Browse files Browse the repository at this point in the history
log user tracebacks in the kernel (INFO-level)

Should make debugging errors a little less painful

closes ipython#2473
  • Loading branch information
minrk committed Jan 23, 2013
2 parents 66ce35c + f36b568 commit 0fd71e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions IPython/zmq/ipkernel.py
Expand Up @@ -418,6 +418,10 @@ def execute_request(self, stream, ident, parent):
reply_content['engine_info'] = e_info
# reset after use
shell._reply_content = None

if 'traceback' in reply_content:
self.log.info("Exception in execute request:\n%s", '\n'.join(reply_content['traceback']))


# At this point, we can tell whether the main code execution succeeded
# or not. If it did, we proceed to evaluate user_variables/expressions
Expand Down Expand Up @@ -629,6 +633,7 @@ def apply_request(self, stream, ident, parent):

self.session.send(self.iopub_socket, u'pyerr', reply_content, parent=parent,
ident=self._topic('pyerr'))
self.log.info("Exception in apply request:\n%s", '\n'.join(reply_content['traceback']))
result_buf = []

if reply_content['ename'] == 'UnmetDependency':
Expand Down

0 comments on commit 0fd71e3

Please sign in to comment.