所以我正在读这篇文章FAQ :
它提到了不可用的getLog()
方法。我当前的类基本上是扩展AbstractHandler
。我该如何使用这个?
最佳答案
如果您让 Eclipse 为您创建 Activator 类,并且您指定了“此插件将为 UI 做出贡献”选项,则该类将类似于:
public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
public Activator() {
}
@Override
public void start(final BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
public void stop(final BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
public static Activator getDefault() {
return plugin;
}
}
然后您可以调用
ILog log = Activator.getDefault().getLog();
访问日志界面
关于java - Eclipse PDE 日志记录缺少方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29737964/