Skip to content

Commit

Permalink
Replace debug_mediator with mediator_log_level
Browse files Browse the repository at this point in the history
  • Loading branch information
Siecje committed Oct 26, 2018
1 parent 9e32b01 commit 7952b02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/jupyterhub_config.py
Expand Up @@ -5,5 +5,5 @@
# use the sudo spawner
c.JupyterHub.spawner_class = 'sudospawner.SudoSpawner'

c.SudoSpawner.debug_mediator = True
c.SudoSpawner.mediator_log_level = "DEBUG"
c.JupyterHub.log_level = 10
10 changes: 9 additions & 1 deletion sudospawner/spawner.py
Expand Up @@ -11,6 +11,7 @@
import shutil
import sys
import os
import warnings

from tornado import gen
from tornado.ioloop import IOLoop
Expand All @@ -30,6 +31,10 @@ class SudoSpawner(LocalProcessSpawner):
sudo_args = List(['-nH'], config=True,
help="Extra args to pass to sudo"
)
mediator_log_level = Unicode("INFO", config=True,
help="Log level for the mediator process",
)
# TODO: deprecated in > 0.5.2
debug_mediator = Bool(False, config=True,
help="Extra log output from the mediator process for debugging",
)
Expand Down Expand Up @@ -58,7 +63,10 @@ def do(self, action, **kwargs):
cmd.extend(self.sudo_args)
cmd.append(self.sudospawner_path)
if self.debug_mediator:
cmd.append('--logging=debug')
self.mediator_log_level = 'DEBUG'
warnings.warn("debug_mediator is deprecated in favor of mediator_log_level", DeprecationWarning)
if self.mediator_log_level:
cmd.append('--logging={}'.format(self.mediator_log_level))

self.log.debug("Spawning %s", cmd)
p = Subprocess(cmd, stdin=Subprocess.STREAM, stdout=Subprocess.STREAM, stderr=Subprocess.STREAM, preexec_fn=self.make_preexec_fn())
Expand Down

0 comments on commit 7952b02

Please sign in to comment.