org.eclipse.jem.util.logger.proxy.Logger.write()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(9.6k)|赞(0)|评价(0)|浏览(240)

本文整理了Java中org.eclipse.jem.util.logger.proxy.Logger.write()方法的一些代码示例,展示了Logger.write()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.write()方法的具体详情如下:
包路径:org.eclipse.jem.util.logger.proxy.Logger
类名称:Logger
方法名:write

Logger.write介绍

[英]deprecated use log(Throwable)
[中]不推荐使用日志(可丢弃)

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core

  1. protected void log(IEJBValidationContext vc, String message) {
  2. Logger logger = vc.getMsgLogger();
  3. if (logger != null && logger.isLoggingLevel(Level.SEVERE)) {
  4. logger.write(Level.SEVERE, message);
  5. }
  6. }

代码示例来源:origin: org.eclipse/org.eclipse.wst.validation

  1. private void logInvocationTargetException(Logger logger, InvocationTargetException exc) {
  2. if (logger.isLoggingLevel(Level.SEVERE)) {
  3. LogEntry entry = ValidationPlugin.getLogEntry();
  4. entry.setSourceID("ValidationBuilder::build"); //$NON-NLS-1$
  5. entry.setTargetException(exc);
  6. logger.write(Level.SEVERE, entry);
  7. if (exc.getTargetException() != null) {
  8. entry.setTargetException(exc);
  9. logger.write(Level.SEVERE, entry);
  10. }
  11. }
  12. }

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee

  1. protected IModule[] createModules(IProject project) {
  2. try {
  3. ModuleCoreNature nature = (ModuleCoreNature) project.getNature(IModuleConstants.MODULE_NATURE_ID);
  4. if (nature != null)
  5. return createModules(nature);
  6. } catch (CoreException e) {
  7. Logger.getLogger().write(e);
  8. }
  9. return null;
  10. }

代码示例来源:origin: org.eclipse/org.eclipse.jst.jee

  1. protected IModule[] createModules(IProject project) {
  2. try {
  3. ModuleCoreNature nature = (ModuleCoreNature) project.getNature(IModuleConstants.MODULE_NATURE_ID);
  4. if (nature != null)
  5. return createModules(nature);
  6. } catch (CoreException e) {
  7. Logger.getLogger().write(e);
  8. }
  9. return null;
  10. }

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core

  1. protected void logMissingRule(IEJBValidationContext vc, Object ruleId) {
  2. Logger logger = vc.getMsgLogger();
  3. if (logger != null && logger.isLoggingLevel(Level.SEVERE)) {
  4. logger.write(Level.SEVERE, ruleId + " = null"); //$NON-NLS-1$
  5. }
  6. addInternalErrorMessage(vc);
  7. }

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core

  1. protected void logMissingRule(IEJBValidationContext vc, Object ruleId) {
  2. Logger logger = vc.getMsgLogger();
  3. if (logger != null && logger.isLoggingLevel(Level.SEVERE)) {
  4. logger.write(Level.SEVERE, ruleId + " = null"); //$NON-NLS-1$
  5. }
  6. addInternalErrorMessage(vc);
  7. }
  8. protected void addInternalErrorMessage(IEJBValidationContext vc) {

代码示例来源:origin: org.wso2.carbonstudio/org.eclipse.bpel.runtimes

  1. protected IModule createModuleDelegates(IProject project, IFile file) {
  2. try {
  3. IModule module = createModule(
  4. project.getName().concat(">>" + file.getProjectRelativePath().toString()),
  5. project.getName() + "/" + file.getProjectRelativePath().toString(),
  6. IBPELModuleFacetConstants.BPEL20_MODULE_TYPE,
  7. getVersion(project),
  8. project);
  9. BPELModuleDelegate moduleDelegate = new BPELModuleDelegate(project, file);
  10. moduleDelegates.put(module, moduleDelegate);
  11. return module;
  12. } catch (Exception e) {
  13. Logger.getLogger().write(e);
  14. }
  15. return null;
  16. }

代码示例来源:origin: org.eclipse/org.eclipse.wst.validation

  1. private void logBuildError(Logger logger, Throwable exc) {
  2. if (logger.isLoggingLevel(Level.SEVERE)) {
  3. if( ! (exc instanceof OperationCanceledException) ){
  4. LogEntry entry = ValidationPlugin.getLogEntry();
  5. entry.setSourceID("ValidationBuilder.build(int, Map, IProgressMonitor)"); //$NON-NLS-1$
  6. entry.setTargetException(exc);
  7. logger.write(Level.SEVERE, entry);
  8. }
  9. }
  10. }

代码示例来源:origin: org.eclipse/org.eclipse.jst.jee

  1. protected IModule[] createModules(ModuleCoreNature nature) {
  2. IProject project = nature.getProject();
  3. try {
  4. IVirtualComponent comp = ComponentCore.createComponent(project);
  5. return createModuleDelegates(comp);
  6. } catch (Exception e) {
  7. Logger.getLogger().write(e);
  8. }
  9. return null;
  10. }

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee

  1. protected IModule[] createModules(ModuleCoreNature nature) {
  2. IProject project = nature.getProject();
  3. try {
  4. IVirtualComponent comp = ComponentCore.createComponent(project);
  5. return createModuleDelegates(comp);
  6. } catch (Exception e) {
  7. Logger.getLogger().write(e);
  8. }
  9. return null;
  10. }

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core

  1. private void addInternalErrorMessage(IEJBValidationContext vc, Throwable exc) {
  2. IMessage mssg = vc.getMessage();
  3. mssg.setId(IEJBValidatorMessageConstants.CHKJ2900);
  4. vc.addMessage(mssg);
  5. if(exc != null) {
  6. Logger logger = vc.getMsgLogger();
  7. if (logger != null && logger.isLoggingLevel(Level.SEVERE)) {
  8. logger.write(Level.SEVERE, exc);
  9. }
  10. }
  11. }

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core

  1. protected void addInternalErrorMessage(IEJBValidationContext vc, Throwable exc) {
  2. IMessage mssg = vc.getMessage();
  3. mssg.setId(IEJBValidatorMessageConstants.CHKJ2900);
  4. vc.addMessage(mssg);
  5. if(exc != null) {
  6. Logger logger = vc.getMsgLogger();
  7. if (logger != null && logger.isLoggingLevel(Level.SEVERE)) {
  8. logger.write(Level.SEVERE, exc);
  9. }
  10. }
  11. }

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core

  1. protected void addInternalErrorMessage(IEJBValidationContext vc, Throwable exc) {
  2. IMessage mssg = vc.getMessage();
  3. mssg.setId(internalErrorMessage());
  4. vc.addMessage(mssg);
  5. if(exc != null) {
  6. Logger logger = vc.getMsgLogger();
  7. if (logger != null && logger.isLoggingLevel(Level.SEVERE)) {
  8. logger.write(Level.SEVERE, exc);
  9. }
  10. }
  11. }

代码示例来源:origin: org.eclipse/org.eclipse.wst.validation

  1. private void logDisabledValidator(IllegalArgumentException exc) {
  2. // Even the IValidator is invalid. Unfortunately, can't disable the
  3. // validator because it can't be found by the registry reader.
  4. // Log the reason for the disabled validator
  5. Logger logger = ValidationPlugin.getPlugin().getMsgLogger();
  6. if (logger.isLoggingLevel(Level.SEVERE)) {
  7. LogEntry entry = ValidationPlugin.getLogEntry();
  8. entry.setSourceID("WorkbenchReporter::addMessage(IValidator, IMessage)"); //$NON-NLS-1$
  9. entry.setTargetException(exc);
  10. logger.write(Level.SEVERE, entry);
  11. }
  12. return;
  13. }

代码示例来源:origin: org.eclipse/org.eclipse.wst.validation

  1. private void logBuilderTimeEntry(long start, int executionMap, Logger logger, IResourceDelta delta) {
  2. TimeEntry entry = ValidationPlugin.getTimeEntry();
  3. entry.setSourceID("ValidationBuilder.build(int, Map, IProgressMonitor)"); //$NON-NLS-1$
  4. entry.setProjectName(getProject().getName()); //$NON-NLS-1$ //$NON-NLS-2$
  5. entry.setExecutionMap(executionMap);
  6. entry.setElapsedTime(System.currentTimeMillis() - start);
  7. if (delta == null) {
  8. entry.setDetails("delta == null"); //$NON-NLS-1$
  9. }
  10. entry.setToolName("ValidationBuilder"); //$NON-NLS-1$
  11. logger.write(Level.FINE, entry);
  12. }
  13. }

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.ejb

  1. public static String getExternalizedMessage(String key) {
  2. try {
  3. return J2EEValidationResourceHandler.getExternalizedMessage(VALIDATION_PROP_FILE_NAME, key, getHandler().getClass());
  4. } catch (NullPointerException exc) {
  5. if (getMsgLogger().isLoggingLevel(Level.SEVERE)) {
  6. LogEntry entry = getLogEntry();
  7. entry.setSourceID("ResourceHandler.getExternalizedMessage(String)"); //$NON-NLS-1$
  8. entry.setText(key);
  9. entry.setTargetException(exc);
  10. getMsgLogger().write(Level.SEVERE, entry);
  11. }
  12. }
  13. return ""; //$NON-NLS-1$
  14. }

代码示例来源:origin: org.eclipse/org.eclipse.wst.validation

  1. public static void removeAllMessages(IResource resource, String[] validatorNames, String targetObjectName) {
  2. try {
  3. TaskListUtility.removeAllTasks(resource, validatorNames, targetObjectName);
  4. } catch (CoreException exc) {
  5. // Couldn't remove the task from the task list for some reason...
  6. Logger logger = ValidationPlugin.getPlugin().getMsgLogger();
  7. if (logger.isLoggingLevel(Level.SEVERE)) {
  8. LogEntry entry = ValidationPlugin.getLogEntry();
  9. entry.setSourceID("WorkbenchReporter.removeAllMessages(String[], IResource, String)"); //$NON-NLS-1$
  10. entry.setTargetException(exc);
  11. logger.write(Level.SEVERE, entry);
  12. }
  13. }
  14. }

代码示例来源:origin: org.eclipse/org.eclipse.wst.validation

  1. public static void removeMessageSubset(IResource resource, String[] ownerId, String targetObjectName, String groupName) {
  2. try {
  3. TaskListUtility.removeTaskSubset(resource, ownerId, targetObjectName, groupName);
  4. } catch (CoreException exc) {
  5. // Couldn't remove the task to the task list for some reason...
  6. Logger logger = ValidationPlugin.getPlugin().getMsgLogger();
  7. if (logger.isLoggingLevel(Level.SEVERE)) {
  8. LogEntry entry = ValidationPlugin.getLogEntry();
  9. entry.setSourceID("WorkbenchReporter.removeMessageSubset(String[], IResource, String, String)"); //$NON-NLS-1$
  10. entry.setTargetException(exc);
  11. logger.write(Level.SEVERE, entry);
  12. }
  13. }
  14. }

代码示例来源:origin: org.eclipse/org.eclipse.wst.validation

  1. public static void addMessage(IResource resource, String messageOwnerId, ClassLoader cl, IMessage message, String targetObjectName, String location) {
  2. int severity = message.getSeverity();
  3. try {
  4. TaskListUtility.addTask(messageOwnerId, resource, location, message.getId(), message.getText(cl), severity,targetObjectName, message.getGroupName(), message.getOffset(), message.getLength());
  5. } catch (CoreException exc) {
  6. // Couldn't add the task to the task list for some reason...
  7. Logger logger = ValidationPlugin.getPlugin().getMsgLogger();
  8. if (logger.isLoggingLevel(Level.SEVERE)) {
  9. LogEntry entry = ValidationPlugin.getLogEntry();
  10. entry.setSourceID("WorkbenchReporter.addMessage(Class,, IResource, IMessage, String, String"); //$NON-NLS-1$
  11. entry.setTargetException(exc);
  12. logger.write(Level.SEVERE, entry);
  13. }
  14. }
  15. }

代码示例来源:origin: org.eclipse/org.eclipse.wst.validation

  1. public static void addMessage(IResource resource, String messageOwnerId, ClassLoader cl, IMessage message, String targetObjectName, String location, String markerId) {
  2. int severity = message.getSeverity();
  3. try {
  4. TaskListUtility.addTask(messageOwnerId, resource, location, message.getId(), message.getText(cl), severity,markerId,targetObjectName, message.getGroupName(), message.getOffset(), message.getLength());
  5. } catch (CoreException exc) {
  6. // Couldn't add the task to the task list for some reason...
  7. Logger logger = ValidationPlugin.getPlugin().getMsgLogger();
  8. if (logger.isLoggingLevel(Level.SEVERE)) {
  9. LogEntry entry = ValidationPlugin.getLogEntry();
  10. entry.setSourceID("WorkbenchReporter.addMessage(Class,, IResource, IMessage, String, String"); //$NON-NLS-1$
  11. entry.setTargetException(exc);
  12. logger.write(Level.SEVERE, entry);
  13. }
  14. }
  15. }

相关文章