Example usage for java.io PrintStream println

List of usage examples for java.io PrintStream println

Introduction

In this page you can find the example usage for java.io PrintStream println.

Prototype

public void println(Object x) 

Source Link

Document

Prints an Object and then terminate the line.

Usage

From source file:com.adaptris.util.stream.Slf4jLoggingOutputStreamTest.java

@Test
public void testLogTrace() throws Exception {
    PrintStream out = new PrintStream(new Slf4jLoggingOutputStream("TRACE"));
    out.println(TEXT);
    out.flush();/*  w  ww. j  av  a2  s.co m*/
    out.close();
}

From source file:com.datatorrent.netlet.benchmark.util.BenchmarkResults.java

public void printResults(PrintStream out) {
    StringBuilder results = new StringBuilder();
    results.append("results=");
    results.append(getResults());/* ww  w.ja v  a2s.co  m*/
    out.println(results);
}

From source file:hudson.plugins.clearcase.changelog.UcmChangeLogSet.java

@Override
public void saveToFile(File changeLogFile) throws IOException {

    FileOutputStream fileOutputStream = new FileOutputStream(changeLogFile);

    PrintStream stream = new PrintStream(fileOutputStream, false, "UTF-8");

    stream.println("<?xml version='1.0' encoding='UTF-8'?>");
    stream.println("<history>");
    for (UcmActivity activity : history) {
        stream.println("\t<entry>");
        stream.println("\t\t<name>" + escapeXml(activity.getName()) + "</name>");
        stream.println("\t\t<headline>" + escapeXml(activity.getHeadline()) + "</headline>");
        stream.println("\t\t<stream>" + escapeXml(activity.getStream()) + "</stream>");
        stream.println("\t\t<user>" + escapeXml(activity.getUser()) + "</user>");
        for (UcmActivity subActivity : activity.getSubActivities()) {
            printSubActivity(stream, subActivity);
        }/* ww w.ja  v  a  2s  . c o  m*/
        for (hudson.plugins.clearcase.objects.AffectedFile file : activity.getFiles()) {
            printFile(stream, file);
        }
        stream.println("\t</entry>");
    }
    stream.println("</history>");

    stream.close();
    fileOutputStream.close();
}

From source file:net.praqma.jenkins.plugin.prqa.QAFrameworkRemoteReport.java

private void logCmdResult(CmdResult result, PrintStream out) {
    if (result == null) {
        return;//  w  ww . j a  va2  s.  c o  m
    }
    out.println(result.stdoutBuffer.toString());
}

From source file:android.database.DatabaseUtils.java

/**
 * Prints the contents of a Cursor's current row to a PrintSteam.
 *
 * @param cursor the cursor to print/*  w  w  w.  j av a2  s  . c o  m*/
 * @param stream the stream to print to
 */
public static void dumpCurrentRow(Cursor cursor, PrintStream stream) {
    String[] cols = cursor.getColumnNames();
    stream.println("" + cursor.getPosition() + " {");
    int length = cols.length;
    for (int i = 0; i < length; i++) {
        String value;
        try {
            value = cursor.getString(i);
        } catch (SQLiteException e) {
            // assume that if the getString threw this exception then the column is not
            // representable by a string, e.g. it is a BLOB.
            value = "<unprintable>";
        }
        stream.println("   " + cols[i] + '=' + value);
    }
    stream.println("}");
}

From source file:com.adaptris.util.stream.Slf4jLoggingOutputStreamTest.java

@Test
public void testLogInfo() throws Exception {
    PrintStream out = new PrintStream(new Slf4jLoggingOutputStream(LogLevel.INFO));
    out.println(TEXT);
    out.flush();//w ww. ja v  a  2s .c  o  m
    out.close();
}

From source file:com.adaptris.util.stream.Slf4jLoggingOutputStreamTest.java

@Test
public void testLogWarn() throws Exception {
    PrintStream out = new PrintStream(new Slf4jLoggingOutputStream(LogLevel.WARN));
    out.println(TEXT);
    out.flush();//from w ww . j  ava2 s  . com
    out.close();
}

From source file:com.adaptris.util.stream.Slf4jLoggingOutputStreamTest.java

@Test
public void testLogDebug() throws Exception {
    PrintStream out = new PrintStream(new Slf4jLoggingOutputStream(LogLevel.DEBUG));
    out.println(TEXT);
    out.flush();/* w w w  .ja  v a 2  s  . c  o m*/
    out.close();
}

From source file:com.adaptris.util.stream.Slf4jLoggingOutputStreamTest.java

@Test
public void testLogError() throws Exception {
    PrintStream out = new PrintStream(new Slf4jLoggingOutputStream(LogLevel.ERROR));
    out.println(TEXT);
    out.flush();//from   w  w  w .j  a va  2 s . c o  m
    out.close();
}

From source file:com.adaptris.util.stream.Slf4jLoggingOutputStreamTest.java

@Test
public void testLogFatal() throws Exception {
    PrintStream out = new PrintStream(new Slf4jLoggingOutputStream(LogLevel.FATAL));
    out.println(TEXT);
    out.flush();/*from www. j  av  a  2  s.  c  om*/
    out.close();
}