本文整理汇总了Java中org.eclipse.core.runtime.ILog.removeLogListener方法的典型用法代码示例。如果您正苦于以下问题:Java ILog.removeLogListener方法的具体用法?Java ILog.removeLogListener怎么用?Java ILog.removeLogListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.ILog
的用法示例。
在下文中一共展示了ILog.removeLogListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testLogExceptionThrowable
import org.eclipse.core.runtime.ILog; //导入方法依赖的package包/类
@Test
public void testLogExceptionThrowable() throws Exception {
ILog log = Activator.getDefault().getLog();
String [] msg = new String [] {"",""};
ILogListener listener = new ILogListener() {
@Override
public void logging(IStatus status, String plugin) {
msg [0] = status.getMessage();
if (status.getSeverity()==IStatus.ERROR) {
msg [1] = "error";
}
}
};
log.addLogListener(listener);
try {
ResourceManager.logException(new Exception("test"));
assertEquals("test",msg [0]);
assertEquals("error",msg [1]);
} finally {
log.removeLogListener(listener);
}
}
示例2: testLogExceptionThrowableString
import org.eclipse.core.runtime.ILog; //导入方法依赖的package包/类
@Test
public void testLogExceptionThrowableString() throws Exception {
ILog log = Activator.getDefault().getLog();
String [] msg = new String [] {"",""};
ILogListener listener = new ILogListener() {
@Override
public void logging(IStatus status, String plugin) {
msg [0] = status.getMessage();
if (status.getSeverity()==IStatus.ERROR) {
msg [1] = "error";
}
}
};
log.addLogListener(listener);
try {
ResourceManager.logException(new Exception("message"));
assertEquals("message",msg [0]);
assertEquals("error",msg [1]);
} finally {
log.removeLogListener(listener);
}
}
示例3: testLogInfo
import org.eclipse.core.runtime.ILog; //导入方法依赖的package包/类
@Test
public void testLogInfo() throws Exception {
ILog log = Activator.getDefault().getLog();
String [] msg = new String [] {"",""};
ILogListener listener = new ILogListener() {
@Override
public void logging(IStatus status, String plugin) {
msg [0] = status.getMessage();
if (status.getSeverity()==IStatus.INFO) {
msg [1] = "info";
}
}
};
log.addLogListener(listener);
IJavaProject jp = null;
try {
jp = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, false, false);
PreferenceManager.setLogInfoEnabled (jp.getProject().getName(),true);
ResourceManager.logInfo(jp.getProject().getName(), "infomessage");
assertEquals("infomessage",msg [0]);
assertEquals("info",msg [1]);
} finally {
PreferenceManager.setLogInfoEnabled (jp.getProject().getName(),false);
log.removeLogListener(listener);
}
}
示例4: removeLogListener
import org.eclipse.core.runtime.ILog; //导入方法依赖的package包/类
/**
* @param listener
*/
public static void removeLogListener(ILogListener listener) {
ILog log = Activator.getDefault().getLog();
log.removeLogListener(listener);
}
示例5: errorsDetected
import org.eclipse.core.runtime.ILog; //导入方法依赖的package包/类
public boolean errorsDetected() {
ILog groovyLogger = GroovyCoreActivator.getDefault().getLog();
groovyLogger.removeLogListener(this);
return 0 != errors.size();
}