提交 8b9ca06f 编写于 作者: D Daniel Beck

Added logging when filtering descriptors.

上级 06c8dcea
...@@ -9,6 +9,9 @@ import jenkins.model.Jenkins; ...@@ -9,6 +9,9 @@ import jenkins.model.Jenkins;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.logging.Logger;
import java.util.logging.Level;
/** /**
* Hides {@link Descriptor}s from users. * Hides {@link Descriptor}s from users.
* *
...@@ -18,6 +21,8 @@ import java.util.List; ...@@ -18,6 +21,8 @@ import java.util.List;
*/ */
public abstract class DescriptorVisibilityFilter implements ExtensionPoint { public abstract class DescriptorVisibilityFilter implements ExtensionPoint {
private static final Logger LOGGER = Logger.getLogger(DescriptorVisibilityFilter.class.getName());
/** /**
* Decides if the given descriptor should be visible to the user. * Decides if the given descriptor should be visible to the user.
* *
...@@ -46,9 +51,19 @@ public abstract class DescriptorVisibilityFilter implements ExtensionPoint { ...@@ -46,9 +51,19 @@ public abstract class DescriptorVisibilityFilter implements ExtensionPoint {
OUTER: OUTER:
for (T d : source) { for (T d : source) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Determining visibility of " + d + " in context " + context);
}
for (DescriptorVisibilityFilter f : filters) { for (DescriptorVisibilityFilter f : filters) {
if (!f.filter(context,d)) if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.finer("Querying " + f + " for visibility of " + d + " in " + context);
}
if (!f.filter(context,d)) {
if (LOGGER.isLoggable(Level.CONFIG)) {
LOGGER.config("Filter " + f + " hides " + d + " in context " + context);
}
continue OUTER; // veto-ed. not shown continue OUTER; // veto-ed. not shown
}
} }
r.add(d); r.add(d);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册