Skip to content

Commit

Permalink
Add show_tracebacks trait
Browse files Browse the repository at this point in the history
  • Loading branch information
vidartf committed Jun 5, 2020
1 parent 0ecb418 commit 6dd660d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion voila/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Voila(Application):
examples = 'voila example.ipynb --port 8888'

flags = {
'debug': ({'Voila': {'log_level': logging.DEBUG}}, _("Set the log level to logging.DEBUG")),
'debug': ({'Voila': {'log_level': logging.DEBUG, 'show_tracebacks': True}}, _("Set the log level to logging.DEBUG")),
'no-browser': ({'Voila': {'open_browser': False}}, _('Don\'t open the notebook in a browser after startup.'))
}

Expand Down Expand Up @@ -188,6 +188,10 @@ class Voila(Application):
)
)

show_tracebacks = Bool(False, config=True, help=_(
'Whether to send tracebacks to clients on exceptions.'
))

port_retries = Integer(50, config=True,
help=_("The number of additional ports to try if the specified port is not available.")
)
Expand Down
2 changes: 1 addition & 1 deletion voila/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def strip_code_cell_warnings(cell):

def should_strip_error(config):
"""Return True if errors should be stripped from the Notebook, False otherwise, depending on the current config."""
return 'Voila' not in config or 'log_level' not in config['Voila'] or config['Voila']['log_level'] != logging.DEBUG
return 'Voila' not in config or config['Voila'].get('show_tracebacks', False)


class VoilaExecutor(NotebookClient):
Expand Down

0 comments on commit 6dd660d

Please sign in to comment.