本文整理汇总了Java中com.intellij.execution.process.ProcessOutputTypes.STDERR属性的典型用法代码示例。如果您正苦于以下问题:Java ProcessOutputTypes.STDERR属性的具体用法?Java ProcessOutputTypes.STDERR怎么用?Java ProcessOutputTypes.STDERR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.execution.process.ProcessOutputTypes
的用法示例。
在下文中一共展示了ProcessOutputTypes.STDERR属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
@Override
protected void setUp() throws Exception {
super.setUp();
mySplitter = new OutputLineSplitter(false) {
@Override
protected void onLineAvailable(@NotNull String text, @NotNull Key outputType, boolean tcLikeFakeOutput) {
if (ProcessOutputTypes.STDERR != outputType && ProcessOutputTypes.SYSTEM != outputType) outputType = ProcessOutputTypes.STDOUT;
synchronized (myOutput) {
List<String> list = myOutput.get(outputType);
if (list == null) {
myOutput.put(outputType, list = new ArrayList<String>());
}
list.add(text);
}
}
};
}
示例2: notifyTextAvailable
@Override
public void notifyTextAvailable(String text, Key outputType) {
super.notifyTextAvailable(text, outputType);
if (StringUtil.isEmptyOrSpaces(text)) {
return;
}
String[] lines = text.split("[\\n\\r]+");
for (String line : lines) {
String l = line.toLowerCase();
if (outputType == ProcessOutputTypes.STDOUT) {
myInfoMessages.add(line);
}
else if (outputType == ProcessOutputTypes.STDERR) {
if (l.contains(IGNORING) || l.contains(SKIPPING) || l.contains(DEBUGGABLE_ERROR)) {
myInfoMessages.add(line);
}
else {
myErrorMessages.add(line);
}
}
}
}
示例3: notifyLine
/**
* Notify single line
*
* @param line a line to notify
* @param outputType output type
*/
private void notifyLine(final String line, final Key outputType) {
String trimmed = LineHandlerHelper.trimLineSeparator(line);
// if line ends with return, then it is a progress line, ignore it
if (myVcs != null && !"\r".equals(line.substring(trimmed.length()))) {
if (outputType == ProcessOutputTypes.STDOUT) {
if (!isStdoutSuppressed() && !mySilent && !StringUtil.isEmptyOrSpaces(line)) {
myVcs.showMessages(trimmed);
LOG.info(line.trim());
}
else {
OUTPUT_LOG.debug(line.trim());
}
}
else if (outputType == ProcessOutputTypes.STDERR && !isStderrSuppressed() && !mySilent && !StringUtil.isEmptyOrSpaces(line)) {
myVcs.showErrorMessages(trimmed);
LOG.info(line.trim());
}
else {
LOG.debug(line.trim());
}
}
myLineListeners.getMulticaster().onLineAvailable(trimmed, outputType);
}
示例4: notifyTextAvailable
public void notifyTextAvailable(final String text, final Key outputType) {
if (LOG.isDebugEnabled()) {
LOG.debug("Received from groovyc " + outputType + ": " + text);
}
if (outputType == ProcessOutputTypes.SYSTEM) {
return;
}
if (outputType == ProcessOutputTypes.STDERR && !isSafeStderr(text)) {
stdErr.append(StringUtil.convertLineSeparators(text));
return;
}
parseOutput(text);
}
示例5: notifyLine
/**
* Notify single line
*
* @param line a line to notify
* @param outputType output type
*/
private void notifyLine(final String line, final Key outputType) {
String trimmed = LineHandlerHelper.trimLineSeparator(line);
// if line ends with return, then it is a progress line, ignore it
if (myVcs != null && !"\r".equals(line.substring(trimmed.length()))) {
if (outputType == ProcessOutputTypes.STDOUT && !isStdoutSuppressed() && !mySilent && !StringUtil.isEmptyOrSpaces(line)) {
myVcs.showMessages(trimmed);
LOG.info(line.trim());
}
else if (outputType == ProcessOutputTypes.STDERR && !isStderrSuppressed() && !mySilent && !StringUtil.isEmptyOrSpaces(line)) {
myVcs.showErrorMessages(trimmed);
LOG.info(line.trim());
}
else {
LOG.debug(line.trim());
}
}
myLineListeners.getMulticaster().onLineAvailable(trimmed, outputType);
}
示例6: notifyTextAvailable
public void notifyTextAvailable(final String text, final Key outputType) {
super.notifyTextAvailable(text, outputType);
if (LOG.isDebugEnabled()) {
LOG.debug("Received from groovyc: " + text);
}
if (outputType == ProcessOutputTypes.SYSTEM) {
return;
}
if (outputType == ProcessOutputTypes.STDERR) {
stdErr.append(StringUtil.convertLineSeparators(text));
return;
}
parseOutput(text);
}
示例7: notifyLines
/**
* Notify listeners for each complete line. Note that in the case of stderr, the last line is
* saved.
*/
protected void notifyLines(final Key outputType, final Iterable<String> lines) {
BuckEventsConsumer buckEventsConsumer =
project.getComponent(BuckModule.class).getBuckEventsConsumer();
if (outputType == ProcessOutputTypes.STDERR) {
StringBuilder stderr = new StringBuilder();
for (String line : lines) {
// Check if the line has at least one character or digit
if (CHARACTER_DIGITS_PATTERN.matcher(line).matches()) {
stderr.append(line);
}
}
if (stderr.length() != 0) {
buckEventsConsumer.consumeConsoleEvent(stderr.toString());
}
}
}
示例8: setUp
@Override
protected void setUp() throws Exception {
super.setUp();
mySplitter = new OutputLineSplitter(false) {
@Override
protected void onLineAvailable(@Nonnull String text, @Nonnull Key outputType, boolean tcLikeFakeOutput) {
if (ProcessOutputTypes.STDERR != outputType && ProcessOutputTypes.SYSTEM != outputType) outputType = ProcessOutputTypes.STDOUT;
synchronized (myOutput) {
List<String> list = myOutput.get(outputType);
if (list == null) {
myOutput.put(outputType, list = new ArrayList<String>());
}
list.add(text);
}
}
};
}
示例9: onTextAvailable
@Override
public void onTextAvailable(ProcessEvent event, Key outputType) {
if (outputType == ProcessOutputTypes.STDERR) {
err.append(event.getText());
}
else if (outputType == ProcessOutputTypes.SYSTEM) {
// skip
}
else {
out.append(event.getText());
}
}
示例10: processLine
@Override
@NotNull
public MyProcessingResult processLine(String line) {
final String type = LogConsolePreferences.getType(line);
Key contentType = type != null
? LogConsolePreferences.getProcessOutputTypes(type)
: (LogConsolePreferences.ERROR.equals(myPrevType) ? ProcessOutputTypes.STDERR : ProcessOutputTypes.STDOUT);
if (type != null) {
myPrevType = type;
}
final boolean applicable = isApplicable(line);
return new MyProcessingResult(contentType, applicable, null);
}
示例11: outputTypeForAttributes
public ConsoleViewContentType outputTypeForAttributes(Key attributes) {
final ConsoleViewContentType outputType;
if (attributes == ProcessOutputTypes.STDERR) {
outputType = ConsoleViewContentType.ERROR_OUTPUT;
}
else if (attributes == ProcessOutputTypes.SYSTEM) {
outputType = ConsoleViewContentType.SYSTEM_OUTPUT;
}
else {
outputType = ConsoleViewContentType.getConsoleViewType(attributes);
}
return outputType;
}
示例12: onTextAvailable
protected void onTextAvailable(final String text, final Key outputType) {
Iterator<String> lines = LineHandlerHelper.splitText(text).iterator();
if (ProcessOutputTypes.STDOUT == outputType) {
notifyLines(outputType, lines, myStdoutLine);
}
else if (ProcessOutputTypes.STDERR == outputType) {
notifyLines(outputType, lines, myStderrLine);
}
}
示例13: resolveOutputType
@NotNull
protected Key resolveOutputType(@NotNull String line, @NotNull Key outputType) {
Key result = outputType;
if (!ProcessOutputTypes.SYSTEM.equals(outputType)) {
Matcher errorMatcher = SvnUtil.ERROR_PATTERN.matcher(line);
Matcher warningMatcher = SvnUtil.WARNING_PATTERN.matcher(line);
result = errorMatcher.find() || warningMatcher.find() ? ProcessOutputTypes.STDERR : ProcessOutputTypes.STDOUT;
}
return result;
}
示例14: onTextAvailable
private void onTextAvailable(final String text, final Key outputType) {
Iterator<String> lines = LineHandlerHelper.splitText(text).iterator();
if (ProcessOutputTypes.STDOUT == outputType) {
notifyLines(outputType, lines, myStdoutLine);
}
else if (ProcessOutputTypes.STDERR == outputType) {
notifyLines(outputType, lines, myStderrLine);
}
}
示例15: notifyTextAvailable
@Override
public void notifyTextAvailable(String text, Key outputType) {
text = StringUtil.convertLineSeparators(text);
if (LOG.isDebugEnabled()) {
LOG.debug(outputType + text);
}
if (outputType == ProcessOutputTypes.STDOUT) {
myStdOut.append(text);
}
else if (outputType == ProcessOutputTypes.STDERR) {
myStdErr.append(text);
}
}