From 2bcc25e31d25fff1d413fe17a291c0721bab75ff Mon Sep 17 00:00:00 2001 From: MinRK Date: Sun, 21 Sep 2014 15:00:38 -0700 Subject: [PATCH] add Spawner.debug for easy debugging of the single-process output --- jupyterhub/spawner.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/jupyterhub/spawner.py b/jupyterhub/spawner.py index 231f15e8..956efcf6 100644 --- a/jupyterhub/spawner.py +++ b/jupyterhub/spawner.py @@ -15,7 +15,7 @@ from tornado.ioloop import IOLoop from IPython.config import LoggingConfigurable from IPython.utils.traitlets import ( - Any, Dict, Enum, Instance, Integer, List, Unicode, + Any, Bool, Dict, Enum, Instance, Integer, List, Unicode, ) @@ -38,6 +38,19 @@ class Spawner(LoggingConfigurable): hub = Any() api_token = Unicode() + debug = Bool(False, config=True, + help="Enable debug-logging of the single-user server" + ) + def _debug_changed(self, name, old, new): + try: + # remove --debug if False, + # and avoid doubling it if True + self.cmd.remove('--debug') + except ValueError: + pass + if new: + self.cmd.append('--debug') + env_prefix = Unicode('JPY_') def _env_key(self, d, key, value): d['%s%s' % (self.env_prefix, key)] = value