Skip to content

Add a logger to the ExtensionPoint API #1523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion jupyter_server/extension/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import importlib
import logging
from itertools import starmap

from tornado.gen import multi
Expand All @@ -24,6 +25,12 @@ class ExtensionPoint(HasTraits):

metadata = Dict()

log = Instance(logging.Logger)

@default("log")
def _default_log(self):
return logging.getLogger("ExtensionPoint")

@validate_trait("metadata")
def _valid_metadata(self, proposed):
"""Validate metadata."""
Expand Down Expand Up @@ -227,7 +234,7 @@ def _load_metadata(self):
raise ExtensionModuleNotFound(msg) from None
# Create extension point interfaces for each extension path.
for m in self.metadata:
point = ExtensionPoint(metadata=m)
point = ExtensionPoint(metadata=m, log=self.log)
self.extension_points[point.name] = point
return name

Expand Down