printf debug

This commit is contained in:
Micke Nordin 2024-01-18 10:12:28 +01:00
parent 9e06575a5d
commit 5b128371f1
Signed by untrusted user: Micke
GPG key ID: F53C4CC83EDAB3BE

View file

@ -170,15 +170,17 @@ hub:
from urllib.parse import urlparse from urllib.parse import urlparse
from tornado.httpserver import HTTPServer from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop from tornado.ioloop import IOLoop
from tornado.log import app_log
from tornado.web import Application, RequestHandler, authenticated from tornado.web import Application, RequestHandler, authenticated
from jupyterhub.services.auth import HubAuthenticated from jupyterhub.services.auth import HubAuthenticated
def my_debug(s):
with open("/proc/1/fd/1", "a") as stdout:
print(s, file=stdout)
class RefreshHandler(HubAuthenticated, RequestHandler): class RefreshHandler(HubAuthenticated, RequestHandler):
@authenticated @authenticated
def get(self): def get(self):
app_log.info(f"DEBUG: In refresh get {os.environ}") my_debug(f"DEBUG: In refresh get")
# user_model = self.get_current_user() # user_model = self.get_current_user()
user_model = {'helloooooo': 'hej'} user_model = {'helloooooo': 'hej'}
self.set_header('content-type', 'application/json') self.set_header('content-type', 'application/json')
@ -187,6 +189,7 @@ hub:
class PingHandler(RequestHandler): class PingHandler(RequestHandler):
def get(self): def get(self):
my_debug(f"DEBUG: In ping get")
self.set_header('content-type', 'application/json') self.set_header('content-type', 'application/json')
self.write(json.dumps({'ping': 1})) self.write(json.dumps({'ping': 1}))