com.intellij.openapi.diagnostic.Logger.warn()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(109)

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

Logger.warn介绍

暂无

代码示例

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@NotNull
private Kind getKind() {
 try {
  return Kind.values()[kind];
 }
 catch (Exception e) {
  LOG.warn("Unknown kind '" + kind + "' of variable '" + name + "'");
  return Kind.Invalid;
 }
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@Nullable
public static BallerinaLSPState getInstance() {
  try {
    return ServiceManager.getService(BallerinaLSPState.class);
  } catch (final Exception e) {
    LOG.warn("Couldn't load BallerinaLSPState");
    LOG.warn(e);
    ApplicationUtils$.MODULE$.invokeLater(() -> Messages.showErrorDialog("Couldn't load LSP settings, you will need to reconfigure them.", "LSP plugin"));
    return null;
  }
}

代码示例来源:origin: KronicDeth/intellij-elixir

@Nullable
public static <T> T transformStdoutLine(@NotNull Function<String, T> lineTransformer,
                    int timeout,
                    @NotNull String workDir,
                    @NotNull String exePath,
                    @NotNull String... arguments) {
 T transformed = null;
 try {
  com.intellij.execution.process.ProcessOutput output = getProcessOutput(timeout, workDir, exePath, arguments);
  transformed = transformStdoutLine(output, lineTransformer);
 } catch (ExecutionException executionException) {
  LOGGER.warn(executionException);
 }
 return transformed;
}

代码示例来源:origin: KronicDeth/intellij-elixir

@Override
public String put(String key, String value) {
  if (key == null || value == null) {
    LOG.error(new Exception("Nulls are not allowed"));
    return null;
  }
  if (key.isEmpty()) {
    // Windows: passing an environment variable with empty name causes "CreateProcess error=87, The parameter is incorrect"
    LOG.warn("Skipping environment variable with empty name, value: " + value);
    return null;
  }
  return super.put(key, value);
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

LOG.warn(e);
  LOG.warn(e);
LOG.warn(e);

代码示例来源:origin: KronicDeth/intellij-elixir

@Nullable
private Release detectSdkVersion(@NotNull String sdkHome) {
  String versionCacheKey = getVersionCacheKey(sdkHome);
  Release release;
  if (mySdkHomeToReleaseCache.containsKey(versionCacheKey)) {
    release = mySdkHomeToReleaseCache.get(versionCacheKey);
  } else {
    File elixir = Elixir.getScriptInterpreterExecutable(sdkHome);
    if (!elixir.canExecute()) {
      String reason = elixir.getPath() + (elixir.exists() ? " is not executable." : " is missing.");
      LOG.warn("Can't detect Elixir version: " + reason);
      release = null;
    } else {
      release = transformStdoutLine(
          Release::fromString,
          STANDARD_TIMEOUT,
          sdkHome,
          elixir.getAbsolutePath(),
          "-e",
          "System.version() |> IO.puts()"
      );
    }
    mySdkHomeToReleaseCache.put(versionCacheKey, release);
  }
  return release;
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@Override
public void loadState(@NotNull final BallerinaLSPState lspState) {
  try {
    XmlSerializerUtil.copyBean(lspState, this);
    LOG.info("LSP State loaded");
    if (extToServ != null && !extToServ.isEmpty()) {
      PluginMain.setExtToServerDefinition(UserConfigurableServerDefinition$.MODULE$.fromArrayMap(extToServ));
    }
    if (timeouts != null && !timeouts.isEmpty()) {
      Timeout.setTimeouts(timeouts);
    }
    if (forcedAssociations != null && !forcedAssociations.isEmpty()) {
      PluginMain.setForcedAssociations(forcedAssociations);
    }
  } catch (final Exception e) {
    LOG.warn("Couldn't load BallerinaLSPState");
    LOG.warn(e);
    ApplicationUtils$.MODULE$.invokeLater(() -> Messages.showErrorDialog("Couldn't load LSP settings, you will need to reconfigure them.", "LSP plugin"));
  }
}

代码示例来源:origin: KronicDeth/intellij-elixir

/**
 * Returns the text of the PSI element.
 *
 * @return the element text.
 */
@Override
public String getText() {
  PsiElement mirror = getMirror();
  String text;
  if (mirror != null) {
    text = mirror.getText();
  } else {
    StringBuilder buffer = new StringBuilder();
    appendMirrorText(buffer, 0);
    LOGGER.warn(
        "Mirror wasn't set for " + this + " in " + getContainingFile() +
        ", expected text '" + buffer + "'"
    );
    text = buffer.toString();
  }
  return text;
}

代码示例来源:origin: KronicDeth/intellij-elixir

LOGGER.warn(messageBuilder.toString());
} else {
  try {
      releaseBySdkHome.put(getVersionCacheKey(sdkHome), release);
    } else {
      LOGGER.warn("Failed to detect Erlang version.\n" +
          "StdOut: " + output.getStdout() + "\n" +
          "StdErr: " + output.getStderr());
    LOGGER.warn(e);

代码示例来源:origin: KronicDeth/intellij-elixir

LOGGER.warn(stringBuilder.toString());
} else {
  byte[] readAhead = new byte[readAheadLength];

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

LOG.warn(e);
LOG.warn(e);

代码示例来源:origin: KronicDeth/intellij-elixir

indicator.setText2("Refreshing");
} catch (ExecutionException e) {
  LOG.warn(e);

代码示例来源:origin: jshiell/checkstyle-idea

private void disableCheckStyleLogging() {
  try {
    // This is a nasty hack to get around IDEA's DialogAppender sending any errors to the Event Log,
    // which would result in CheckStyle parse errors spamming the Event Log.
    org.apache.log4j.Logger.getLogger("com.puppycrawl.tools.checkstyle.TreeWalker").setLevel(Level.OFF);
  } catch (Exception e) {
    LOG.warn("Unable to suppress logging from CheckStyle's TreeWalker", e);
  }
}

代码示例来源:origin: jshiell/checkstyle-idea

private String detokeniseForPrefix(final String path, final File projectPath, final String prefix) {
  if (projectPath != null) {
    return new File(projectPath, path.substring(prefix.length())).getAbsolutePath();
  }
  LOG.warn("Could not detokenise path as project dir is unset: " + path);
  return path;
}

代码示例来源:origin: jshiell/checkstyle-idea

private Optional<PluginConfigurationManager> settings() {
  final Project project = checkinPanel.getProject();
  if (project == null) {
    LOG.warn("Could not get project for check-in panel");
    return empty();
  }
  final CheckStylePlugin plugin = project.getComponent(CheckStylePlugin.class);
  if (plugin == null) {
    LOG.warn("Could not get CheckStyle Plug-in, skipping");
    return empty();
  }
  return ofNullable(plugin.configurationManager());
}

代码示例来源:origin: jshiell/checkstyle-idea

private static List<URL> pathsOf(final VirtualFile[] files) {
  final List<URL> outputPaths = new ArrayList<>();
  for (final VirtualFile file : files) {
    try {
      outputPaths.add(urlFor(pathOf(file)));
    } catch (MalformedURLException e) {
      LOG.warn("Malformed virtual file URL: " + file, e);
    }
  }
  return outputPaths;
}

代码示例来源:origin: jshiell/checkstyle-idea

public Map<PsiFile, List<Problem>> scanFiles(@NotNull final List<VirtualFile> files) {
  if (files.isEmpty()) {
    return Collections.emptyMap();
  }
  try {
    return whenFinished(runAsyncCheck(new ScanFiles(this, files, null))).get();
  } catch (final Throwable e) {
    LOG.warn("Error scanning files", e);
    return Collections.emptyMap();
  }
}

代码示例来源:origin: jshiell/checkstyle-idea

private void addProblemTo(final PsiElement victim,
             final PsiFile psiFile,
             @NotNull final Issue event,
             final boolean afterEndOfLine) {
  try {
    addProblem(psiFile, new Problem(victim, event.message, event.severityLevel, event.lineNumber,
        event.columnNumber, event.sourceName, afterEndOfLine, suppressErrors));
  } catch (PsiInvalidElementAccessException e) {
    LOG.warn("Element access failed", e);
  }
}

代码示例来源:origin: jshiell/checkstyle-idea

@Nullable
private ConfigurationLocation deserialiseLocation(@NotNull final Map<String, String> pLoadedMap,
                         @NotNull final String pKey) {
  final String serialisedLocation = pLoadedMap.get(pKey);
  try {
    final ConfigurationLocation location = configurationLocationFactory.create(project, serialisedLocation);
    location.setProperties(propertiesFor(pLoadedMap, pKey));
    return location;
  } catch (IllegalArgumentException e) {
    LOG.warn("Could not parse location: " + serialisedLocation, e);
    return null;
  }
}

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

private void checkProject() {
  if(!this.isEnabled()
    && !Settings.getInstance(project).dismissEnableNotification
    && VfsUtil.findRelativeFile(this.project.getBaseDir(), "vendor", "symfony") != null
    ) {
    IdeHelper.notifyEnableMessage(project);
    return;
  }
  if(this.getContainerFiles().size() == 0) {
    Symfony2ProjectComponent.getLogger().warn("missing at least one container file");
  }
}

相关文章