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

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

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

Logger.getLogger介绍

[英]Get the system default logger. This is used for clients that don't know if they are running in Eclipse or outside of it. This way they have a common logger format which switch correctly.
[中]获取系统默认记录器。这用于不知道自己是在Eclipse中运行还是在Eclipse之外运行的客户端。这样,他们就有了一个可以正确切换的通用记录器格式。

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.jem.util

/**
 * Get the Logger for this plugin.
 * 
 * @return logger for this plugin.
 * 
 * @since 1.0.0
 */
public static Logger getLogger() {
  return Logger.getLogger(ID);
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.common.frameworks.ui

private void validateSettings() {
  if (wizardID == null || wizardPageFactoryElement == null) {
    Logger.getLogger().logError("Incomplete page extension specification."); //$NON-NLS-1$
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jem.util

public boolean readElement(IConfigurationElement element) {
    if (element.getName().equals("factoryClass")) //$NON-NLS-1$
      try {
        factoryHolder[0] = (EMFWorkbenchContextFactory)element.createExecutableExtension("name"); //$NON-NLS-1$
        return true;
      } catch (CoreException e) {
        Logger.getLogger().logError(e);
      }                
    return false;
  }
};

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

protected IRoleShapeStrategy getDefaultRoleShapeStrategy() {
  try {
    return (IRoleShapeStrategy) getRoleStrategyConstructor(this).newInstance(new Object[] { this });
  } catch (Throwable t) {
    Logger.getLogger().logError("EJBRelationshipRoleImpl:Could not instantiate role shape strategy; this requires extensions"); //$NON-NLS-1$
    Logger.getLogger().logError(t);
    return null;
  }
}

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

protected String getDefinesExtension(String providerType) {
  readRegistryIfNecessary();
  String element = (String) definesExtensions.get(providerType);
  if (null == element) {
    Logger.getLogger().log(new RuntimeException("Extension:" + EXTENSION + " Element:" + DEFINES_TYPE_ELEMENT + " not found for " + ATTRIBUTE_PROVIDER_TYPE + ": " + providerType)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
  }
  return element;
}

代码示例来源:origin: org.eclipse/org.eclipse.jem.util

/**
 * @param natureId
 */
private void registerNatureID(String natureId) {
  if (!REGISTERED_NATURE_IDS.contains(natureId))
    REGISTERED_NATURE_IDS.add(natureId);
  else
    Logger.getLogger().logError(EMFWorkbenchResourceHandler.getString("EMFNatureRegistry_ERROR_0", new Object[] {natureId})); //$NON-NLS-1$
}

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

/**
 * @param existingClasspathEntries
 */
public static void removeNonSeverTargetClasspathEntries(IProject project, List existingClasspathEntries) {
  try {
    JemProjectUtilities.removeFromJavaClassPath(project, existingClasspathEntries);
  } catch (JavaModelException jme) {
    Logger.getLogger().logError(jme);
  }
}

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

public Logger getMsgLogger() {
  if (logger == null) {
    logger = Logger.getLogger(getPluginID());
    setRenderer(logger);
  }
  return logger;
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.common.emfworkbench.integration

private void init() {
  id = element.getAttribute(ID_ATTR);
  if (id == null) {
    Logger.getLogger().logError("Incorrect usage of editModelExtension extension point.  Element must contain id attribute.  Plugin: " + getPluginId()); //$NON-NLS-1$
    return;
  }
  editModelID = element.getAttribute(EditModelExtensionRegistry.EDIT_MODEL_ID_ATTR);
  resources = new ArrayList();
  IConfigurationElement[] editModelResources = element.getChildren(EditModelResource.EDIT_MODEL_RESOURCE_ELEMENT);
  for (int j = 0; j < editModelResources.length; j++)
    resources.add(new EditModelResource(editModelResources[j], id));
}

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

public Logger getMsgLogger() {
  if (logger == null) {
    logger = Logger.getLogger(getPluginID());
    setRenderer(logger);
  }
  return logger;
}

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

public static void logError(IConfigurationElement element, String text) {
    IExtension extension = element.getDeclaringExtension();
    StringBuffer buf = new StringBuffer();
    buf.append("Plugin " + extension.getNamespace() + ", extension " + extension.getExtensionPointUniqueIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
    buf.append("\n" + text); //$NON-NLS-1$
    Logger.getLogger().logError(buf.toString());
  }
}

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

/**
   * shouldContinueAndMakeFileEditable method comment.
   */
  public boolean shouldContinueAndMakeFileEditable(org.eclipse.core.resources.IFile aFile) {
    if (aFile == null)
      return false;
    String error = WTPResourceHandler.getString("Unable_to_save_read-only_f_ERROR_", new Object[]{aFile.getFullPath()}); //$NON-NLS-1$ = "Unable to save read-only file: "
    Logger.getLogger().logError(error);
    return false;
  }
}

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

protected void handleManifestException(IOException ex, Archive anArchive) throws ValidationException {
  Logger.getLogger().logError(ex);
  String tmp = NLS.bind(EARValidationMessageResourceHandler.ERROR_READING_MANIFEST_ERROR_, new String[]{anArchive.getURI()});		
  IMessage message = new LocalizedMessage(IMessage.HIGH_SEVERITY, tmp);
  throw new ValidationException(message, ex);
}

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

protected IModule[] createModules(IProject project) {
  try {
    ModuleCoreNature nature = (ModuleCoreNature) project.getNature(IModuleConstants.MODULE_NATURE_ID);
    if (nature != null)
      return createModules(nature);
  } catch (CoreException e) {
    Logger.getLogger().write(e);
  }
  return null;
}

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

protected Archive openNestedArchive(String uri) {
  try {
    return ((Archive) getContainer()).openNestedArchive(uri);
  } catch (OpenFailureException e) {
    //Caught an exception trying to open the nested archive
    Logger.getLogger().logError(e);
    return null;
  }
}

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

protected IModule[] createModules(IProject project) {
  try {
    ModuleCoreNature nature = (ModuleCoreNature) project.getNature(IModuleConstants.MODULE_NATURE_ID);
    if (nature != null)
      return createModules(nature);
  } catch (CoreException e) {
    Logger.getLogger().write(e);
  }
  return null;
}

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

public void close() {
  try {
    if (commonArchive != null) {
      commonArchive.close();
    }
    if (archive != null) {
      JavaEEArchiveUtilities.INSTANCE.closeArchive(archive);
    }
  } catch (RuntimeException e) {
    Logger.getLogger().logError(e);
    throw e;
  }
}

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

protected IModule[] createModules(ModuleCoreNature nature) {
  IProject project = nature.getProject();
  try {
    IVirtualComponent comp = ComponentCore.createComponent(project);
    return createModuleDelegates(comp);
  } catch (Exception e) {
    Logger.getLogger().write(e);
  }
  return null;
}

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

protected void createImportedClassesFolder() {
  importedClassesFolderCreated = true;
  IContainer jarParent = vComponent.getRootFolder().getUnderlyingFolder().getParent();
  importedClassesFolder = jarParent.getFolder(new Path(IMPORTED_CLASSES));
  try {
    importedClassesFolder.create(true, true, null);
  } catch (CoreException e1) {
    Logger.getLogger().logError(e1);
  }
}

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

protected void createImportedClassesFolder() {
  importedClassesFolderCreated = true;
  IContainer jarParent = vComponent.getRootFolder().getUnderlyingFolder().getParent();
  importedClassesFolder = jarParent.getFolder(new Path(IMPORTED_CLASSES));
  try {
    importedClassesFolder.create(true, true, null);
  } catch (CoreException e1) {
    Logger.getLogger().logError(e1);
  }
}

相关文章