From ec13af58d70637769ef3ef43e9c1ed650585b2fa Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Thu, 1 Dec 2016 16:00:25 -0500 Subject: [PATCH] Add debug log for static file paths --- notebook/base/handlers.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/notebook/base/handlers.py b/notebook/base/handlers.py index b07975fb1..b5e985ba7 100755 --- a/notebook/base/handlers.py +++ b/notebook/base/handlers.py @@ -40,6 +40,12 @@ non_alphanum = re.compile(r'[^A-Za-z0-9]') sys_info = json.dumps(get_sys_info()) +def log(): + if Application.initialized(): + return Application.instance().log + else: + return app_log + class AuthenticatedHandler(web.RequestHandler): """A RequestHandler with an authenticated user.""" @@ -141,10 +147,7 @@ class IPythonHandler(AuthenticatedHandler): @property def log(self): """use the IPython log by default, falling back on tornado's logger""" - if Application.initialized(): - return Application.instance().log - else: - return app_log + return log() @property def jinja_template_vars(self): @@ -538,6 +541,9 @@ class FileFindHandler(IPythonHandler, web.StaticFileHandler): return '' cls._static_paths[path] = abspath + + + log().debug("Path %s served from %s"%(path, abspath)) return abspath def validate_absolute_path(self, root, absolute_path):