Java Code Examples for com.intellij.execution.ui.ConsoleViewContentType#ERROR_OUTPUT

The following examples show how to use com.intellij.execution.ui.ConsoleViewContentType#ERROR_OUTPUT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlazeConsoleScope.java    From intellij with Apache License 2.0 6 votes vote down vote up
private void print(String text, ConsoleViewContentType contentType) {
  blazeConsoleService.print(text, contentType);
  blazeConsoleService.print("\n", contentType);

  if (activated) {
    return;
  }
  boolean activate =
      popupBehavior == FocusBehavior.ALWAYS
          || (popupBehavior == FocusBehavior.ON_ERROR
              && contentType == ConsoleViewContentType.ERROR_OUTPUT);
  if (activate) {
    activated = true;
    ApplicationManager.getApplication().invokeLater(blazeConsoleService::activateConsoleWindow);
  }
}
 
Example 2
Source File: BlazeConsoleServiceImpl.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public void print(String text, ConsoleViewContentType contentType) {
  Key<?> key =
      contentType == ConsoleViewContentType.ERROR_OUTPUT
          ? ProcessOutputTypes.STDERR
          : ProcessOutputTypes.STDOUT;
  ansiEscapeDecoder.escapeText(text, key, this);
}
 
Example 3
Source File: UnityDebugProcess.java    From consulo-unity3d with Apache License 2.0 5 votes vote down vote up
private void print(String text, String stacktrace, ConsoleView view, ConsoleViewContentType contentType)
{
	view.print(text + "\n", contentType);
	if(contentType == ConsoleViewContentType.ERROR_OUTPUT && !StringUtil.isEmpty(stacktrace))
	{
		StringBuilder builder = new StringBuilder();
		String[] strings = StringUtil.splitByLines(stacktrace);
		for(String line : strings)
		{
			builder.append("  at ").append(line).append("\n");
		}

		view.print(builder.toString(), contentType);
	}
}
 
Example 4
Source File: MockPrinter.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void print(String s, ConsoleViewContentType contentType) {
  myHasPrinted = true;
  myAllOut.append(s);
  if (contentType == ConsoleViewContentType.NORMAL_OUTPUT) {
    myStdOut.append(s);
  }
  else if (contentType == ConsoleViewContentType.ERROR_OUTPUT) {
    myStdErr.append(s);
  }
  else if (contentType == ConsoleViewContentType.SYSTEM_OUTPUT) {
    myStdSys.append(s);
  }
}
 
Example 5
Source File: CppDebugRunner.java    From CppTools with Apache License 2.0 5 votes vote down vote up
@Override
public String getRunCommandText(CppRunConfiguration configuration, CppDebugProcess<CppRunConfiguration> cppDebugProcess) {
  String runCommand = "run";

  if (!CppDebuggerConstants.gdbCanNotRedirectOutputOfDebuggedCommand) {
    File outFile;
    File errFile;

    try {
      // TODO: output redirecting from parameters!
      outFile = File.createTempFile("out", "");
      errFile = File.createTempFile("err", "");

      ReadFileTask task = new ReadFileTask(outFile, ConsoleViewContentType.NORMAL_OUTPUT, cppDebugProcess);

      ApplicationManager.getApplication().executeOnPooledThread(task);
      ReadFileTask task2 = new ReadFileTask(errFile, ConsoleViewContentType.ERROR_OUTPUT, cppDebugProcess);
      ApplicationManager.getApplication().executeOnPooledThread(task2);

      String executableParameters = configuration.getRunnerParameters().getExecutableParameters();
      if (!CppRunConfiguration.isEmpty(executableParameters)) runCommand += " " + executableParameters;
      
      runCommand += " >" + outFile.getPath() + " 2>" + errFile.getPath();
    } catch (IOException ex) {
      // TODO:
      ex.printStackTrace();
    }
  }

  return runCommand;
}
 
Example 6
Source File: TestResultsXmlFormatter.java    From consulo with Apache License 2.0 4 votes vote down vote up
private static String getTypeString(ConsoleViewContentType type) {
  return type == ConsoleViewContentType.ERROR_OUTPUT ? "stderr" : "stdout";
}
 
Example 7
Source File: LogConsolePreferences.java    From consulo with Apache License 2.0 4 votes vote down vote up
public static ConsoleViewContentType getContentType(String type) {
  if (type.equals(ERROR)) return ConsoleViewContentType.ERROR_OUTPUT;
  return ConsoleViewContentType.NORMAL_OUTPUT;
}