Skip to content

Commit

Permalink
temp: Add more logging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansick committed May 15, 2024
1 parent 0149913 commit e93773a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/noteburst/jupyterclient/jupyterlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ async def log_into_lab(self) -> None:
method="GET",
body=r.text,
)
self.logger.debug("Logged into JupyterLab with XSRF token")

async def spawn_lab(self) -> JupyterImage:
"""Spawn a JupyterLab pod."""
Expand Down Expand Up @@ -662,6 +663,7 @@ async def open_lab_session(
Send and receive messages from JupyterLab using the ``websocket``
property on `JupyterLabSession`.
"""
self.logger.debug("Opening JupyterLab session")
session_url = self.url_for(f"user/{self.user.username}/api/sessions")
session_type = "notebook" if notebook_name else "console"
body = {
Expand All @@ -673,6 +675,10 @@ async def open_lab_session(
headers = {}
if self._lab_xsrf:
headers["X-XSRFToken"] = self._lab_xsrf
else:
self.logger.warning(
"No XSRF token found for JupyterLab, using hub token."
)
r = await self.http_client.post(
session_url, json=body, headers=headers
)
Expand Down

0 comments on commit e93773a

Please sign in to comment.