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

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

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

Logger.isLoggingLevel介绍

[英]Check if the requested level is being logged. (e.g. if current level is SEVERE, then FINE will not be logged).
[中]检查是否正在记录请求的级别。(例如,如果当前水平严重,则不会记录罚款)。

代码示例

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

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

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

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

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);
}
protected void addInternalErrorMessage(IEJBValidationContext vc) {

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

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

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

private void logInvocationTargetException(Logger logger, InvocationTargetException exc) {
  if (logger.isLoggingLevel(Level.SEVERE)) {
    LogEntry entry = ValidationPlugin.getLogEntry();
    entry.setSourceID("ValidationBuilder::build"); //$NON-NLS-1$
    entry.setTargetException(exc);
    logger.write(Level.SEVERE, entry);
    if (exc.getTargetException() != null) {
      entry.setTargetException(exc);
      logger.write(Level.SEVERE, entry);
    }
  }
}

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

public static String getLocationText(IWorkbenchContext helper, Object targetObject) {
  String location = null;
  try {
    location = helper.getLocation(targetObject);
  } catch (Exception exc) {
    Logger logger = ValidationPlugin.getPlugin().getMsgLogger();
    if (logger.isLoggingLevel(Level.SEVERE)) {
      LogEntry entry = ValidationPlugin.getLogEntry();
      entry.setSourceID("WorkbenchReporter.getLocationText(Object)"); //$NON-NLS-1$
      entry.setTargetException(exc);
      logger.write(Level.SEVERE, entry);
    }
  }
  if ((location == null) || (location.trim().equals(""))) { //$NON-NLS-1$
    location = DEFAULT_LOCATION;
  }
  return location;
}

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

private void addInternalErrorMessage(IEJBValidationContext vc, Throwable exc) {
  IMessage mssg = vc.getMessage();
  mssg.setId(IEJBValidatorMessageConstants.CHKJ2900);
  vc.addMessage(mssg);
  if(exc != null) {
    Logger logger = vc.getMsgLogger();
    if (logger != null && logger.isLoggingLevel(Level.SEVERE)) {
      logger.write(Level.SEVERE, exc);
    }
  }
}

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

protected void addInternalErrorMessage(IEJBValidationContext vc, Throwable exc) {
  IMessage mssg = vc.getMessage();
  mssg.setId(IEJBValidatorMessageConstants.CHKJ2900);
  vc.addMessage(mssg);
  if(exc != null) {
    Logger logger = vc.getMsgLogger();
    if (logger != null && logger.isLoggingLevel(Level.SEVERE)) {
      logger.write(Level.SEVERE, exc);
    }
  }
}

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

protected void addInternalErrorMessage(IEJBValidationContext vc, Throwable exc) {
  IMessage mssg = vc.getMessage();
  mssg.setId(internalErrorMessage());
  vc.addMessage(mssg);
  if(exc != null) {
    Logger logger = vc.getMsgLogger();
    if (logger != null && logger.isLoggingLevel(Level.SEVERE)) {
      logger.write(Level.SEVERE, exc);
    }
  }
}

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

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

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

public static String getExternalizedMessage(String key) {
  try {
    return J2EEValidationResourceHandler.getExternalizedMessage(VALIDATION_PROP_FILE_NAME, key, getHandler().getClass());
  } catch (NullPointerException exc) {
    if (getMsgLogger().isLoggingLevel(Level.SEVERE)) {
      LogEntry entry = getLogEntry();
      entry.setSourceID("ResourceHandler.getExternalizedMessage(String)"); //$NON-NLS-1$
      entry.setText(key);
      entry.setTargetException(exc);
      getMsgLogger().write(Level.SEVERE, entry);
    }
  }
  return ""; //$NON-NLS-1$
}

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

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

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

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

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

private static String getTargetObjectName(IWorkbenchContext helper, Object targetObject) {
  String targetObjectName = null;
  try {
    targetObjectName = helper.getTargetObjectName(targetObject);
  } catch (Exception exc) {
    Logger logger = ValidationPlugin.getPlugin().getMsgLogger();
    if (logger.isLoggingLevel(Level.SEVERE)) {
      LogEntry entry = ValidationPlugin.getLogEntry();
      entry.setSourceID("WorkbenchReporter.getTargetObjectName(Object)"); //$NON-NLS-1$
      entry.setTargetException(exc);
      logger.write(Level.SEVERE, entry);
    }
  }
  return targetObjectName;
}

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

protected Object getValue(IMarker marker, String attribName) {
  if (marker == null) {
    return null;
  }
  try {
    return marker.getAttribute(attribName);
  } catch (CoreException exc) {
    Logger logger = ValidationPlugin.getPlugin().getMsgLogger();
    if (logger.isLoggingLevel(Level.SEVERE)) {
      LogEntry entry = ValidationPlugin.getLogEntry();
      entry.setSourceIdentifier("ValidationConfiguration::getValue(" + attribName + ")"); //$NON-NLS-1$ //$NON-NLS-2$
      entry.setTargetException(exc);
      logger.write(Level.SEVERE, entry);
    }
    return null;
  }
}

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

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

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

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

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

public final void validateMethodWhichMustNotExist(IEJBValidationContext vc, EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) throws InvalidInputException, ValidationCancelledException, ValidationException {
  IMethodType mType = MethodUtility.getUtility().getMethodType(bean, clazz, method, methodsExtendedLists, this);
  if (mType == null) {
    // what happened?
    Logger logger = vc.getMsgLogger();
    if (logger != null && logger.isLoggingLevel(Level.FINEST)) {
      LogEntry entry = vc.getLogEntry();
      entry.setSourceID("EJB20Validator - validate method which must not exist"); //$NON-NLS-1$
      entry.setText("Method type is null: " + MethodUtility.getUtility().getMethodType(bean, clazz, method, methodsExtendedLists, this)); //$NON-NLS-1$
      logger.write(Level.FINEST, entry);
    }
    return;
  }
  IMessage message = MessageUtility.getUtility().getMessage(vc, mType.getMessageId_messageExists(), IEJBValidationContext.INFO, bean, clazz, method, new String[]{mType.getMethodName(bean, clazz, method)}, this);
  vc.addMessage(message);
}

相关文章