当前位置: 代码迷 >> Eclipse >> 怎么使用.options文件来debug Eclipse的插件
  详细解决方案

怎么使用.options文件来debug Eclipse的插件

热度:34   发布时间:2016-04-23 00:12:03.0
如何使用.options文件来debug Eclipse的插件

1.首先你要在你的插件根目录下,创建一个.options的文件

里面的内容如下:

com.example.youcompany.ui/debug=false

就是你的plugin名字/debug,或者任何你自己定义的debug名字。

2.在你的code中使用如下代码来做debug的输出:

    private boolean isDebugEnabled() {        if (debugEnabled == null) {            debugEnabled = Boolean.valueOf(Platform.getDebugOption(pluginId + "/debug"));        }        return debugEnabled.booleanValue();    }        public logError(String errorMsg) {        if(isDebugEnabled) {            //process you log         }    }


3.然后在debug configuration的tracing tab下,enable你的debug符号,


4.Debug 就可以了。

  相关解决方案