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


Java Project.MSG_INFO屬性代碼示例

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


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

示例1: setProcessOutputStream

public void setProcessOutputStream(InputStream inputStream) throws IOException {
    OutputStream os = getOutputStream();
    Integer logLevel = null;
    if (os == null || delegateOutputStream) {
        os = AntBridge.delegateOutputStream(false);
        logLevel = Project.MSG_INFO;
    }
    outTask = new Thread(Thread.currentThread().getThreadGroup(), outCopier = new Copier(inputStream, os, logLevel, outEncoding, foldingHelper),
            "Out Thread for " + getProject().getName()); // NOI18N
    outTask.setDaemon(true);
    outTask.start();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:ForkedJavaOverride.java

示例2: messageLogged

/**
 * This is called for every log message (of any priority). If the
 * current process has been interrupted (the user pressed the stop
 * button) then we throw an exception to interrupt the currently
 * executing Ant task. Other than that, we simply pass INFO and
 * higher messages to the GATE status listener.
 */
@Override
public void messageLogged(BuildEvent buildEvent) {
  // check for interruption
  if(interrupted) {
    interrupted = false;
    throw new BuildException("Export interrupted");
  }
  if(buildEvent.getPriority() <= Project.MSG_INFO) {
    statusChanged(buildEvent.getMessage());
  }
  // log the message to log4j for debugging purposes
  log.debug(buildEvent.getPriority() + ": " + buildEvent.getMessage());
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:20,代碼來源:NameBearerHandle.java

示例3: run

public void run() {
    /*
    StringBuilder content = new StringBuilder();
    long tick = System.currentTimeMillis();
    content.append(String.format("[init: %1.1fsec]", (tick - init) / 1000.0));
     */
    
    if (ow == null && logLevel != null) {
        Vector v = getProject().getBuildListeners();
        for (Object o : v) {
            if (o instanceof NbBuildLogger) {
                NbBuildLogger l = (NbBuildLogger) o;
                err = logLevel != Project.MSG_INFO;
                ow = err ? l.err : l.out;
                session = l.thisSession;
                break;
            }
        }
    }
    try {
        try {
            int c;
            while ((c = in.read()) != -1) {
                if (logLevel == null) {
                    // Input gets sent immediately.
                    out.write(c);
                    out.flush();
                } else {
                    synchronized (this) {
                        if (c == '\n') {                                    
                            String str = currentLine.toString(encoding);
                            int len = str.length();
                            if (len > 0 && str.charAt(len - 1) == '\r') {
                                str = str.substring(0, len - 1);
                            }

                            foldingHelper.checkFolds(str, err, session);
                            if (str.length() < LOGGER_MAX_LINE_LENGTH) { // not too long message, probably interesting
                                // skip stack traces (hyperlinks are created by JavaAntLogger), everything else write directly
                                if (!STACK_TRACE.matcher(str).find()) {
                                    StandardLogger.findHyperlink(str, session, null).println(session, err);
                                }
                            } else {
                                // do not match long strings, directly create a trivial hyperlink
                                StandardLogger.findHyperlink(str, session, null).println(session, err);
                            }
                            log(str, logLevel);
                            currentLine.reset();
                        } else {                                    
                            currentLine.write(c);
                            if(currentLine.size() > 8192) {
                                flusher.run();
                            } else {
                                flusher.schedule(250);
                            }
                        }
                    }    
                }
            }
        } finally {
            if (logLevel != null) {
                maybeFlush();
                if (err) {
                    foldingHelper.clearHandle();
                }
            }
        }
    } catch (IOException x) {
        // ignore IOException: Broken pipe from FileOutputStream.writeBytes in BufferedOutputStream.flush
    } catch (ThreadDeath d) {
        // OK, build just stopped.
        return;
    }
    //System.err.println("copied " + in + " to " + out + "; content='" + content + "'");
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:75,代碼來源:ForkedJavaOverride.java


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