ScriptRunner: Alternate constructor to get verbosity flag

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-01-18 18:07:37 -08:00
parent 6214b1d4bd
commit e688fbfc24
1 changed files with 10 additions and 1 deletions

View File

@ -43,6 +43,7 @@ public class ScriptRunner {
private boolean stopOnError;
private boolean autoCommit;
private boolean verbosity = true;
private String delimiter = DEFAULT_DELIMITER;
private boolean fullLineDelimiter = false;
@ -58,6 +59,13 @@ public class ScriptRunner {
this.stopOnError = stopOnError;
}
public ScriptRunner(Connection connection, boolean autoCommit, boolean stopOnError, boolean verbosity) {
this.connection = connection;
this.autoCommit = autoCommit;
this.stopOnError = stopOnError;
this.verbosity = verbosity;
}
public void setDelimiter(String delimiter, boolean fullLineDelimiter) {
this.delimiter = delimiter;
this.fullLineDelimiter = fullLineDelimiter;
@ -207,7 +215,8 @@ public class ScriptRunner {
private void println(Object o) {
_logBuffer.append(o);
s_logger.debug(_logBuffer.toString());
if (verbosity)
s_logger.debug(_logBuffer.toString());
_logBuffer = new StringBuffer();
}