org.eclipse.jem.util.logger.proxy.Logger类的使用及代码示例

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

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

Logger介绍

[英]This is a base, UI independent logger. It will construct a consistent msg. body, and call an enfironment specific ILogRenderer. By default, this logger will use a console based ILogRenderer, and a J2EE Plugin identification.

When running outside of Eclipse, the trace and logging level come from the system properties

  • "debug" (="true") - The default is false.
  • "logLevel" (="level" where "level" is a level string, e.g. SEVERE, WARNING, etc. from the java.util.logging.Level class). The default is "WARNING".
    [中]这是一个基本的、独立于用户界面的记录器。它将构造一个一致的msg。身体,然后打电话给特定环境的iLogrender。默认情况下,此记录器将使用基于控制台的iLogrender和J2EE插件标识。
    在Eclipse之外运行时,跟踪和日志记录级别来自系统属性
    *“debug”(=“true”)-默认值为false
    *“logLevel”(=“level”,其中“level”是级别字符串,例如java.util.logging.Level类中的严重级别、警告级别等)。默认值为“警告”。

代码示例

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

protected static URL createFileURL(IPath path) {
  try {
    return path.toFile().toURL();
  } catch (MalformedURLException e) {
    Logger.getLogger().log(e, Level.WARNING);
    return null;
  }
}

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

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

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

public static void warn(String message) {
    org.eclipse.jem.util.logger.proxy.Logger.getLogger().logWarning(message);
  }
}

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

/**
   * Create a module from given information and invoke creation of 
   * corresponding module delegate.
   * 
   * @param project <code>IProject</code> the module belongs to
   * @param file <code>IFile</code> representing the module (or is it vice versa?)
   * @return
   */
  protected IModule createModule(IProject project, IFile file) {
    try {
//            IVirtualComponent comp = ComponentCore.createComponent(project);
      return createModuleDelegates(project, file);
    } catch (Exception e) {
      Logger.getLogger().write(e);
    }
    return null;
  }

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

/**
 * deprecated use log(Throwable, Level)
 * @param aLevel
 * @param ex
 * @return
 * 
 * @since 1.0.0
 */
public String log(Level aLevel, Exception ex) {
  return log(ex, aLevel);
}
/**

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

public AdapterFactory createInstance() {
  if (element == null)
    return null;
  AdapterFactory factory = null;
  try {
    factory = (AdapterFactory) element.createExecutableExtension(AdapterFactoryRegistry.CLASS_NAME);
  } catch (CoreException e) {
    JEMUtilPlugin.getLogger().logError(e);
    factory = null;
  }
  return factory;
}

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

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

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

/**
 * Answer if logging at the given level
 * 
 * @param logLevel
 * @return <code>true</code> if logging at the given level.
 * 
 * @since 1.1.0
 */
protected boolean isLogging(Level logLevel) {
  return fTraceMode || fMyLogger.isLoggingLevel(logLevel);
}

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

public void warning(SAXParseException exception) throws SAXException {
    Logger.getLogger().logWarning(exception);
  }
};

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

/**
 * Log an error string.
 * @param msg
 * @return how it was logged. See <code>CONSOLE_DESCRIPTION.</code>
 * 
 * @since 1.0.0
 */
public String logError(String msg) {
  return log(msg, Level.SEVERE);
}

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

public IExtensibleViewFactory createFactoryInstance() {
  IExtensibleViewFactory factoryInstance = null;
  try {
    factoryInstance = (IExtensibleViewFactory) this.element.createExecutableExtension(getFactoryClass());
  } catch (CoreException e) {
    WTPUIPlugin.getLogger().logError(e);
  }
  return factoryInstance;
}

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

protected boolean isLogging(Level level) {
  return fTraceMode || fMyLogger.isLoggingLevel(level);
}

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

protected void primHandleException(String aMessage, Throwable anException) 
  {
    org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(anException);
    throw new RuntimeException(aMessage);

  }
/**

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

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

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

public static void warn(Throwable e){
  org.eclipse.jem.util.logger.proxy.Logger.getLogger().logWarning(e);
}

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

相关文章