com.amazon.redshift.logger.LogConsoleHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redshift-jdbc42 Show documentation
Show all versions of redshift-jdbc42 Show documentation
Java JDBC 4.2 (JRE 8+) driver for Redshift database
The newest version!
package com.amazon.redshift.logger;
import java.io.PrintWriter;
public class LogConsoleHandler implements LogHandler {
private final PrintWriter writer = new PrintWriter(System.out);
@Override
public synchronized void write(String message) throws Exception
{
writer.println(message);
writer.flush();
}
@Override
public synchronized void close() throws Exception {
// Do nothing as Writer is on the stdout.
}
@Override
public synchronized void flush() {
if (writer != null) {
writer.flush();
}
}
}