當前位置: 首頁>>代碼示例>>Java>>正文


Java Logger.error方法代碼示例

本文整理匯總了Java中com.intellij.openapi.diagnostic.Logger.error方法的典型用法代碼示例。如果您正苦於以下問題:Java Logger.error方法的具體用法?Java Logger.error怎麽用?Java Logger.error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.diagnostic.Logger的用法示例。


在下文中一共展示了Logger.error方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fillMaps

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
private static void fillMaps() throws IOException {
  Logger log = Logger.getInstance(UnsupportedFeaturesUtil.class.getName());
  FileReader reader = new FileReader(PythonHelpersLocator.getHelperPath("/tools/versions.xml"));
  try {
    XMLReader xr = XMLReaderFactory.createXMLReader();
    VersionsParser parser = new VersionsParser();
    xr.setContentHandler(parser);
    xr.parse(new InputSource(reader));
  }
  catch (SAXException e) {
    log.error("Improperly formed \"versions.xml\". " + e.getMessage());
  }
  finally {
    reader.close();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:UnsupportedFeaturesUtil.java

示例2: log

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
public static void log(Logger logger, String title, String details, NotificationType level) {
    switch (level) {
        case ERROR:
            logger.error(title, details);
            break;
        case WARNING:
            logger.warn(title + "\n" + details);
            break;
        default:
            logger.info(title + "\n" + details);
    }
    if (StringUtils.isBlank(details)) {
        details = title;
    }
    Notifications.Bus.notify(EVENT_LOG_NOTIFIER.createNotification(title, details, level, null));
}
 
開發者ID:JFrogDev,項目名稱:jfrog-idea-plugin,代碼行數:17,代碼來源:Utils.java

示例3: applyFix

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
public void applyFix(@NotNull Project project,
                     @NotNull ProblemDescriptor descriptor) {
  final PsiElement problemElement = descriptor.getPsiElement();
  if (problemElement == null || !problemElement.isValid()) {
    return;
  }
  if (isQuickFixOnReadOnlyFile(problemElement)) {
    return;
  }
  try {
    doFix(project, descriptor);
  } catch (IncorrectOperationException e) {
    final Class<? extends LuaFix> aClass = getClass();
    final String className = aClass.getName();
    final Logger logger = Logger.getInstance(className);
    logger.error(e);
  }
}
 
開發者ID:internetisalie,項目名稱:lua-for-idea,代碼行數:19,代碼來源:LuaFix.java

示例4: copySpacesAndCommentsBefore

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
public static PsiElement copySpacesAndCommentsBefore(PsiElement elementToReplace,
                                                        PsiElement[] patternElements,
                                                        String replacementToMake,
                                                        PsiElement elementParent) {
  int i = 0;
  while (true) {    // if it goes out of bounds then deep error happens
    if (!(patternElements[i] instanceof PsiComment || patternElements[i] instanceof PsiWhiteSpace)) {
      break;
    }
    ++i;
    if (patternElements.length == i) {
      break;
    }
  }

  if (patternElements.length == i) {
    Logger logger = Logger.getInstance(StructuralSearchProfile.class.getName());
    logger.error("Unexpected replacement structure:" + replacementToMake);
  }

  if (i != 0) {
    elementParent.addRangeBefore(patternElements[0], patternElements[i - 1], elementToReplace);
  }
  return patternElements[i];
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:ReplacerUtil.java

示例5: loadStdlibPackagesList

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
@Nullable
private static Set<String> loadStdlibPackagesList() {
  final Logger log = Logger.getInstance(PyStdlibUtil.class.getName());
  final String helperPath = PythonHelpersLocator.getHelperPath("/tools/stdlib_packages.txt");
  try {
    final BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(helperPath)));
    try {
      final Set<String> result = new HashSet<String>();
      String line;
      while ((line = reader.readLine()) != null) {
        result.add(line);
      }
      return result;
    }
    finally {
      reader.close();
    }
  }
  catch (IOException e) {
    log.error("Cannot read list of standard library packages: " + e.getMessage());
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:24,代碼來源:PyStdlibUtil.java

示例6: fillTestCaseMethods

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
private static void fillTestCaseMethods() throws IOException {
  final Logger log = Logger.getInstance(UnsupportedFeaturesUtil.class.getName());
  final FileReader reader = new FileReader(PythonHelpersLocator.getHelperPath("/tools/class_method_versions.xml"));
  try {
    final XMLReader xr = XMLReaderFactory.createXMLReader();
    final ClassMethodsParser parser = new ClassMethodsParser();
    xr.setContentHandler(parser);
    xr.parse(new InputSource(reader));
  }
  catch (SAXException e) {
    log.error("Improperly formed \"class_method_versions.xml\". " + e.getMessage());
  }
  finally {
    reader.close();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:UnsupportedFeaturesUtil.java

示例7: load

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
@Nullable
@Override
public Optional<Icon> load(@NotNull File key) {
  Logger log = Logger.getInstance(ActivityGalleryStep.class);
  try {
    if (key.isFile()) {
      BufferedImage image = ImageIO.read(key);
      if (image != null) {
        return Optional.<Icon>of(new ImageIcon(image.getScaledInstance(256, 256, Image.SCALE_SMOOTH)));
      }
      else {
        log.error("File " + key.getAbsolutePath() + " exists but is not a valid image");
      }
    }
    else {
      log.error("Image file " + key.getAbsolutePath() + " was not found");
    }
  }
  catch (IOException e) {
    log.warn(e);
  }
  return Optional.absent();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:24,代碼來源:TemplateParameterStep2.java

示例8: prettyFormatResponseToLog

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
public static void prettyFormatResponseToLog(@NotNull Logger logger, @NotNull HttpResponse response) {
  if (logger.isDebugEnabled()) {
    try {
      String content = TaskResponseUtil.getResponseContentAsString(response);
      org.apache.http.Header header = response.getEntity().getContentType();
      String contentType = header == null ? "text/plain" : header.getElements()[0].getName().toLowerCase(Locale.ENGLISH);
      if (contentType.contains("xml")) {
        prettyFormatXmlToLog(logger, content);
      }
      else if (contentType.contains("json")) {
        prettyFormatJsonToLog(logger, content);
      }
      else {
        logger.debug(content);
      }
    }
    catch (IOException e) {
      logger.error(e);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:TaskUtil.java

示例9: visitReferenceElement

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
@Override
public void visitReferenceElement(PsiJavaCodeReferenceElement reference) {
  super.visitReferenceElement(reference);
  final PsiElement parent = PsiTreeUtil.getParentOfType(reference, PsiImportStatementBase.class);
  if (parent != null) {
    return;
  }
  final String text = reference.getText();
  if (!text.equals(fullyQualifiedText)) {
    return;
  }
  final PsiElement qualifier = reference.getQualifier();
  if (qualifier == null) {
    return;
  }
  try {
    qualifier.delete();
  }
  catch (IncorrectOperationException e) {
    final Class<? extends QualificationRemover> aClass = getClass();
    final String className = aClass.getName();
    final Logger logger = Logger.getInstance(className);
    logger.error(e);
  }
  shortenedElements.add(reference);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:UnnecessaryFullyQualifiedNameInspection.java

示例10: applyFix

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
@Override
public final void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
  final PsiElement problemElement = descriptor.getPsiElement();
  if (problemElement == null || !problemElement.isValid()) {
    return;
  }
  if (prepareForWriting() && !FileModificationService.getInstance().preparePsiElementsForWrite(problemElement)) {
    return;
  }
  try {
    doFix(project, descriptor);
  }
  catch (IncorrectOperationException e) {
    final Class<? extends InspectionGadgetsFix> aClass = getClass();
    final String className = aClass.getName();
    final Logger logger = Logger.getInstance(className);
    logger.error(e);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:InspectionGadgetsFix.java

示例11: applyFix

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
@Override
public void applyFix(@NotNull Project project,
                     @NotNull ProblemDescriptor descriptor) {
  final PsiElement problemElement = descriptor.getPsiElement();
  if (problemElement == null || !problemElement.isValid()) {
    return;
  }
  if (isQuickFixOnReadOnlyFile(problemElement)) {
    return;
  }
  try {
    doFix(project, descriptor);
  } catch (IncorrectOperationException e) {
    final Class<? extends GroovyFix> aClass = getClass();
    final String className = aClass.getName();
    final Logger logger = Logger.getInstance(className);
    logger.error(e);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:GroovyFix.java

示例12: applyFix

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
public final void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
  final PsiElement problemElement = descriptor.getPsiElement();
  if (problemElement == null || !problemElement.isValid()) {
    return;
  }
  if (isQuickFixOnReadOnlyFile(problemElement)) {
    return;
  }
  try {
    doFix(project, problemElement);
  }
  catch (IncorrectOperationException e) {
    final Class<? extends TitleCapitalizationFix> aClass = getClass();
    final String className = aClass.getName();
    final Logger logger = Logger.getInstance(className);
    logger.error(e);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:TitleCapitalizationInspection.java

示例13: visitReferenceElement

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
@Override
public void visitReferenceElement(PsiJavaCodeReferenceElement reference) {
  super.visitReferenceElement(reference);
  final PsiElement parent = reference.getParent();
  if (parent instanceof PsiImportStatement) {
    return;
  }
  final String text = reference.getText();
  if (!text.equals(fullyQualifiedText)) {
    return;
  }
  final PsiElement qualifier = reference.getQualifier();
  if (qualifier == null) {
    return;
  }
  try {
    qualifier.delete();
  }
  catch (IncorrectOperationException e) {
    final Class<? extends QualificationRemover> aClass = getClass();
    final String className = aClass.getName();
    final Logger logger = Logger.getInstance(className);
    logger.error(e);
  }
  shortenedElements.add(reference);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:ReplaceFullyQualifiedNameWithImportIntention.java

示例14: logException

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
@NotNull
public RunResult logException(Logger logger) {
  if (myThrowable != null) {
    logger.error(myThrowable);
  }

  return this;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:RunResult.java

示例15: logProblem

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
public static void logProblem(final Logger log, final String msg, boolean throwError, final String testFrameworkName) {
  final String text = getTFrameworkPrefix(testFrameworkName) + msg;
  if (throwError) {
    log.error(text);
  }
  else {
    log.warn(text);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:GeneralTestEventsProcessor.java


注:本文中的com.intellij.openapi.diagnostic.Logger.error方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。