当前位置: 首页>>代码示例>>Java>>正文


Java ConsoleNote类代码示例

本文整理汇总了Java中hudson.console.ConsoleNote的典型用法代码示例。如果您正苦于以下问题:Java ConsoleNote类的具体用法?Java ConsoleNote怎么用?Java ConsoleNote使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ConsoleNote类属于hudson.console包,在下文中一共展示了ConsoleNote类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: eol

import hudson.console.ConsoleNote; //导入依赖的package包/类
@Override
protected void eol(byte[] b, int len) throws IOException {
    delegate.write(b, 0, len);

    String line = ConsoleNote.removeNotes(new String(b, 0, len, Charset.defaultCharset())).trim();
    if (!logs.offer(line)) {
        logger.warning(String.format("Failed to add log line: %s to queue, is the logger rolling too fast?", line));
    }
}
 
开发者ID:Microsoft,项目名称:vsts-jenkins-build-integration-sample,代码行数:10,代码来源:TfsRemoteConsoleLogAppender.java

示例2: getLog

import hudson.console.ConsoleNote; //导入依赖的package包/类
public List<String> getLog(int maxLines) throws IOException {
    int lineCount = 0;
    List<String> logLines = new LinkedList<String>();
    BufferedReader reader =
            new BufferedReader(new InputStreamReader(new FileInputStream(getLogFile()), getCharset()));
    try {
        for (String line = reader.readLine(); line != null; line = reader.readLine()) {
            logLines.add(line);
            ++lineCount;
            // If we have too many lines, remove the oldest line.  This way we
            // never have to hold the full contents of a huge log file in memory.
            // Adding to and removing from the ends of a linked list are cheap
            // operations.
            if (lineCount > maxLines) {
                logLines.remove(0);
            }
        }
    } finally {
        reader.close();
    }

    // If the log has been truncated, include that information.
    // Use set (replaces the first element) rather than add so that
    // the list doesn't grow beyond the specified maximum number of lines.
    if (lineCount > maxLines) {
        logLines.set(0, "[...truncated " + (lineCount - (maxLines - 1)) + " lines...]");
    }

    return ConsoleNote.removeNotes(logLines);

}
 
开发者ID:jenkinsci,项目名称:deployer-framework-plugin,代码行数:32,代码来源:DeployNowRunAction.java

示例3: annotate

import hudson.console.ConsoleNote; //导入依赖的package包/类
@Override
public void annotate(ConsoleNote consoleNote) throws IOException {}
 
开发者ID:GerritForge,项目名称:gerrit-plugin,代码行数:3,代码来源:FakeTaskListener.java

示例4: annotate

import hudson.console.ConsoleNote; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void annotate(ConsoleNote ann) throws IOException {}
 
开发者ID:i-m-c,项目名称:jenkins-inheritance-plugin,代码行数:4,代码来源:DummyListener.java


注:本文中的hudson.console.ConsoleNote类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。