org.eclipse.jdt.internal.core.util.Util.log()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(258)

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

Util.log介绍

[英]Log a message that is potentially repeated in the same session. The first time this method is called with a given exception, the exception stack trace is written to the log.

Only intended for use in debug statements.
[中]记录可能在同一会话中重复的消息。第一次使用给定异常调用此方法时,异常堆栈跟踪会写入日志。
仅用于调试语句。

代码示例

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

@Override
public void handleException(Throwable exception) {
  Util.log(exception, "Exception occurred while loading annotation processor manager"); //$NON-NLS-1$
}
@Override

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

@Override
public void handleException(Throwable exception) {
  Util.log(exception, "Exception occurred in listener of Type hierarchy change notification"); //$NON-NLS-1$
}
@Override

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

@Override
public void handleException(Throwable exception) {
  Util.log(exception, "Exception occurred in listener of Java element change notification"); //$NON-NLS-1$
}
@Override

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public void handleException(Throwable exception) {
  if (exception instanceof Error) {
    throw (Error) exception; // errors are not supposed to be caught
  } else if (exception instanceof OperationCanceledException)
    throw (OperationCanceledException) exception;
  else if (exception instanceof UnsupportedOperationException) {
    // might want to disable participant as it tried to modify the buffer of the working copy being reconciled
    Util.log(exception, "Reconcile participant attempted to modify the buffer of the working copy being reconciled"); //$NON-NLS-1$
  } else
    Util.log(exception, "Exception occurred in reconcile participant"); //$NON-NLS-1$
}
public void run() throws Exception {

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public void handleException(Throwable exception) {
  if (exception instanceof Error) {
    throw (Error) exception; // errors are not supposed to be caught
  } else if (exception instanceof OperationCanceledException)
    throw (OperationCanceledException) exception;
  else if (exception instanceof UnsupportedOperationException) {
    // might want to disable participant as it tried to modify the buffer of the working copy being reconciled
    Util.log(exception, "Reconcile participant attempted to modify the buffer of the working copy being reconciled"); //$NON-NLS-1$
  } else
    Util.log(exception, "Exception occurred in reconcile participant"); //$NON-NLS-1$
}
public void run() throws Exception {

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public void handleException(Throwable exception) {
  if (exception instanceof Error) {
    throw (Error) exception; // errors are not supposed to be caught
  } else if (exception instanceof OperationCanceledException)
    throw (OperationCanceledException) exception;
  else if (exception instanceof UnsupportedOperationException) {
    // might want to disable participant as it tried to modify the buffer of the working copy being reconciled
    Util.log(exception, "Reconcile participant attempted to modify the buffer of the working copy being reconciled"); //$NON-NLS-1$
  } else
    Util.log(exception, "Exception occurred in reconcile participant"); //$NON-NLS-1$
}
public void run() throws Exception {

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

@Override
public void handleException(Throwable exception) {
  Util.log(exception, "Exception occurred while creating compilation participant"); //$NON-NLS-1$
}
@Override

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

@Override
public void handleException(Throwable exception) {
  Util.log(exception, "Exception occurred in listener of Java element change notification"); //$NON-NLS-1$
}
@Override

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

@Override
public void handleException(Throwable exception) {
  Util.log(exception, "Exception occurred in listener of buffer change notification"); //$NON-NLS-1$
}
@Override

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

@Override
public void handleException(Throwable exception) {
  Util.log(exception, "Exception occurred in listener of pre Java resource change notification"); //$NON-NLS-1$
}
@Override

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

/**
   * Logs the given throwable.
   *
   * @param t the throwable
   * @since 3.1
   */
  public static void log(Throwable t) {
    Util.log(t, "Exception occured while formatting comments"); //$NON-NLS-1$
  }
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public static void log(int statusErrorID, String message) {
  log(new Status(
      statusErrorID,
      JavaCore.PLUGIN_ID,
      message));
}

代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps

public static void log(int statusErrorID, String message) {
  log(new Status(
      statusErrorID,
      JavaCore.PLUGIN_ID,
      message));
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public static void log(int statusErrorID, String message) {
  log(new Status(
      statusErrorID,
      JavaCore.PLUGIN_ID,
      message));
}

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

private double getRatioForProperty(String propertyName) {
  String property = System.getProperty(propertyName);
  if (property != null) {
    try {
      return Double.parseDouble(property);
    } catch (NumberFormatException e) {
      // ignore
      Util.log(e, "Could not parse value for " + propertyName + ": " + property); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
  return 1.0;
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

private double getOpenableRatio() {
  String property = System.getProperty(RATIO_PROPERTY);
  if (property != null) {
    try {
      return Double.parseDouble(property);
    } catch (NumberFormatException e) {
      // ignore
      Util.log(e, "Could not parse value for " + RATIO_PROPERTY + ": " + property); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
  return 1.0;
}

代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps

public static void logRepeatedMessage(String key, int statusErrorID, String message) {
  if (key == null) {
    throw new IllegalArgumentException("key cannot be null"); //$NON-NLS-1$
  }
  if (fgRepeatedMessages.contains(key)) {
    return;
  }
  fgRepeatedMessages.add(key);
  log(statusErrorID, message);
}

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

public static void logRepeatedMessage(String key, int statusErrorID, String message) {
  if (key == null) {
    throw new IllegalArgumentException("key cannot be null"); //$NON-NLS-1$
  }
  if (fgRepeatedMessages.contains(key)) {
    return;
  }
  fgRepeatedMessages.add(key);
  log(statusErrorID, message);
}

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

@Override
public IModule getModule() {
  IModuleDescription desc = getModuleDescription();
  if (desc != null) {
    try {
      return (IModule)((JavaElement) desc).getElementInfo();
    } catch (JavaModelException e) {
      Util.log(e);
    }
  }
  return null;
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

public Binding getCompilerBinding() {
  try {
    parse();
    return this.compilerBinding;
  } catch (RuntimeException e) {
    Util.log(e, "Could not create binding from binding key: " + getKey()); //$NON-NLS-1$
    return null;
  }
}

相关文章

Util类方法