From b4623874781240834beefa2c6db013be2793c92f Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 6 Dec 2023 17:35:07 +0100 Subject: [PATCH] log extension import time at debug level unless it's actually slow (#1375) --- jupyter_server/extension/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jupyter_server/extension/utils.py b/jupyter_server/extension/utils.py index 5d18939ab2..1ba44ee0d2 100644 --- a/jupyter_server/extension/utils.py +++ b/jupyter_server/extension/utils.py @@ -68,7 +68,8 @@ def get_metadata(package_name, logger=None): # each module took to import. This makes it much easier for users to report # slow loading modules upstream, as slow loading modules will block server startup if logger: - logger.info(f"Package {package_name} took {duration:.4f}s to import") + log = logger.info if duration > 0.1 else logger.debug + log(f"Extension package {package_name} took {duration:.4f}s to import") try: return module, module._jupyter_server_extension_points()