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

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

本文整理了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

  1. /**
  2. * Get the Logger for this plugin.
  3. *
  4. * @return logger for this plugin.
  5. *
  6. * @since 1.0.0
  7. */
  8. public static Logger getLogger() {
  9. return Logger.getLogger(ID);
  10. }

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

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

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

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

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

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

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

  1. protected String getDefinesExtension(String providerType) {
  2. readRegistryIfNecessary();
  3. String element = (String) definesExtensions.get(providerType);
  4. if (null == element) {
  5. 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$
  6. }
  7. return element;
  8. }

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

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

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

  1. /**
  2. * @param existingClasspathEntries
  3. */
  4. public static void removeNonSeverTargetClasspathEntries(IProject project, List existingClasspathEntries) {
  5. try {
  6. JemProjectUtilities.removeFromJavaClassPath(project, existingClasspathEntries);
  7. } catch (JavaModelException jme) {
  8. Logger.getLogger().logError(jme);
  9. }
  10. }

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

  1. public Logger getMsgLogger() {
  2. if (logger == null) {
  3. logger = Logger.getLogger(getPluginID());
  4. setRenderer(logger);
  5. }
  6. return logger;
  7. }

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

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

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

  1. public Logger getMsgLogger() {
  2. if (logger == null) {
  3. logger = Logger.getLogger(getPluginID());
  4. setRenderer(logger);
  5. }
  6. return logger;
  7. }

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

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

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

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

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

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

代码示例来源: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.j2ee.core

  1. protected Archive openNestedArchive(String uri) {
  2. try {
  3. return ((Archive) getContainer()).openNestedArchive(uri);
  4. } catch (OpenFailureException e) {
  5. //Caught an exception trying to open the nested archive
  6. Logger.getLogger().logError(e);
  7. return null;
  8. }
  9. }

代码示例来源: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

  1. public void close() {
  2. try {
  3. if (commonArchive != null) {
  4. commonArchive.close();
  5. }
  6. if (archive != null) {
  7. JavaEEArchiveUtilities.INSTANCE.closeArchive(archive);
  8. }
  9. } catch (RuntimeException e) {
  10. Logger.getLogger().logError(e);
  11. throw e;
  12. }
  13. }

代码示例来源: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 void createImportedClassesFolder() {
  2. importedClassesFolderCreated = true;
  3. IContainer jarParent = vComponent.getRootFolder().getUnderlyingFolder().getParent();
  4. importedClassesFolder = jarParent.getFolder(new Path(IMPORTED_CLASSES));
  5. try {
  6. importedClassesFolder.create(true, true, null);
  7. } catch (CoreException e1) {
  8. Logger.getLogger().logError(e1);
  9. }
  10. }

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

  1. protected void createImportedClassesFolder() {
  2. importedClassesFolderCreated = true;
  3. IContainer jarParent = vComponent.getRootFolder().getUnderlyingFolder().getParent();
  4. importedClassesFolder = jarParent.getFolder(new Path(IMPORTED_CLASSES));
  5. try {
  6. importedClassesFolder.create(true, true, null);
  7. } catch (CoreException e1) {
  8. Logger.getLogger().logError(e1);
  9. }
  10. }

相关文章