mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-12 04:23:01 +00:00
Use warning instead of warn for logs
This commit is contained in:
@@ -404,7 +404,7 @@ class JupyterHub(Application):
|
|||||||
).tag(config=True)
|
).tag(config=True)
|
||||||
@observe('api_tokens')
|
@observe('api_tokens')
|
||||||
def _deprecate_api_tokens(self, change):
|
def _deprecate_api_tokens(self, change):
|
||||||
self.log.warn("JupyterHub.api_tokens is pending deprecation."
|
self.log.warning("JupyterHub.api_tokens is pending deprecation."
|
||||||
" Consider using JupyterHub.service_tokens."
|
" Consider using JupyterHub.service_tokens."
|
||||||
" If you have a use case for services that identify as users,"
|
" If you have a use case for services that identify as users,"
|
||||||
" let us know: https://github.com/jupyterhub/jupyterhub/issues"
|
" let us know: https://github.com/jupyterhub/jupyterhub/issues"
|
||||||
|
@@ -29,7 +29,7 @@ class RootHandler(BaseHandler):
|
|||||||
def get(self):
|
def get(self):
|
||||||
next_url = self.get_argument('next', '')
|
next_url = self.get_argument('next', '')
|
||||||
if not next_url.startswith('/'):
|
if not next_url.startswith('/'):
|
||||||
self.log.warn("Disallowing redirect outside JupyterHub: %r", next_url)
|
self.log.warning("Disallowing redirect outside JupyterHub: %r", next_url)
|
||||||
next_url = ''
|
next_url = ''
|
||||||
if next_url and next_url.startswith(url_path_join(self.base_url, 'user/')):
|
if next_url and next_url.startswith(url_path_join(self.base_url, 'user/')):
|
||||||
# add /hub/ prefix, to ensure we redirect to the right user's server.
|
# add /hub/ prefix, to ensure we redirect to the right user's server.
|
||||||
|
@@ -182,7 +182,7 @@ class HubAuth(Configurable):
|
|||||||
app_log.error("Upstream failure verifying auth token: [%i] %s", r.status_code, r.reason)
|
app_log.error("Upstream failure verifying auth token: [%i] %s", r.status_code, r.reason)
|
||||||
raise HTTPError(502, "Failed to check authorization (upstream problem)")
|
raise HTTPError(502, "Failed to check authorization (upstream problem)")
|
||||||
elif r.status_code >= 400:
|
elif r.status_code >= 400:
|
||||||
app_log.warn("Failed to check authorization: [%i] %s", r.status_code, r.reason)
|
app_log.warning("Failed to check authorization: [%i] %s", r.status_code, r.reason)
|
||||||
raise HTTPError(500, "Failed to check authorization")
|
raise HTTPError(500, "Failed to check authorization")
|
||||||
else:
|
else:
|
||||||
data = r.json()
|
data = r.json()
|
||||||
|
@@ -168,11 +168,11 @@ class Spawner(LoggingConfigurable):
|
|||||||
print(proposal)
|
print(proposal)
|
||||||
v = proposal['value']
|
v = proposal['value']
|
||||||
if '%U' in v:
|
if '%U' in v:
|
||||||
self.log.warn("%%U for username in %s is deprecated in JupyterHub 0.7, use {username}",
|
self.log.warning("%%U for username in %s is deprecated in JupyterHub 0.7, use {username}",
|
||||||
proposal['trait'].name,
|
proposal['trait'].name,
|
||||||
)
|
)
|
||||||
v = v.replace('%U', '{username}')
|
v = v.replace('%U', '{username}')
|
||||||
self.log.warn("Converting %r to %r", proposal['value'], v)
|
self.log.warning("Converting %r to %r", proposal['value'], v)
|
||||||
return v
|
return v
|
||||||
|
|
||||||
disable_user_config = Bool(False,
|
disable_user_config = Bool(False,
|
||||||
|
Reference in New Issue
Block a user