Commit 8efc49de authored by Nico Mack's avatar Nico Mack

Moved Parameter and Result logging from INFO level to DEBUG level

parent 63ce5d3f
......@@ -62,14 +62,11 @@ public class PythonExecutor extends Executor {
array = new PyArray(Double.class, list.size());
int index = 0;
for (Double value : list) {
// if (value == null)
// value = Double.valueOf(0);
// array.set(index++, new PyFloat(value));
array.set(index++, (value != null) ? new PyFloat(value) : Py.None);
}
engine.set(variable.getName(), array);
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Parameter -> {} = {}", variable.getName(), array.toString()); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Parameter -> {} = {}", variable.getName(), array.toString()); //$NON-NLS-1$
}
} else if (Integer.class.isAssignableFrom(vector.getClassOfValues())) {
......@@ -77,14 +74,11 @@ public class PythonExecutor extends Executor {
array = new PyArray(Integer.class, list.size());
int index = 0;
for (Integer value : list) {
// if (value == null)
// value = Integer.valueOf(0);
// array.set(index++, new PyInteger(value));
array.set(index++, (value != null) ? new PyInteger(value) : Py.None);
}
engine.set(variable.getName(), array);
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Parameter -> {} = {}", variable.getName(), array.toString()); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Parameter -> {} = {}", variable.getName(), array.toString()); //$NON-NLS-1$
}
}
} else {
......@@ -95,8 +89,8 @@ public class PythonExecutor extends Executor {
Double numericValue = Double.valueOf(variable.getValue().toString());
engine.set(variable.getName(), new PyFloat(numericValue));
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Parameter -> {} = {}", variable.getName(), variable.getValue()); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Parameter -> {} = {}", variable.getName(), variable.getValue()); //$NON-NLS-1$
}
}
}
......@@ -108,8 +102,10 @@ public class PythonExecutor extends Executor {
long elapsed = System.currentTimeMillis();
engine.exec(script);
elapsed = System.currentTimeMillis() - elapsed;
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Eval took {} ms | {}", elapsed, script); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Eval took {} ms | {}", elapsed, script); //$NON-NLS-1$
} else if (LOGGER.isInfoEnabled()) {
LOGGER.info("Eval took {} ms", elapsed); //$NON-NLS-1$
}
if (this.executionErrors.size() > 0) {
LOGGER.error("Eval returned an error: {}", this.executionErrors.toString()); //$NON-NLS-1$
......@@ -128,14 +124,14 @@ public class PythonExecutor extends Executor {
if (tupleMatcher.matches()) {
PyTuple tuple = (PyTuple) engine.get(tupleMatcher.group(1));
result = tuple.__getattr__(tupleMatcher.group(2));
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Result <- {} = {}.{} = {}", variable.getName(), tupleMatcher.group(1), tupleMatcher.group(2), result); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Result <- {} = {}.{} = {}", variable.getName(), tupleMatcher.group(1), tupleMatcher.group(2), result); //$NON-NLS-1$
}
}
} else {
result = engine.get(variable.getName());
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Result <- {} = {}", variable.getName(), result); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Result <- {} = {}", variable.getName(), result); //$NON-NLS-1$
}
}
......
......@@ -150,8 +150,9 @@ public class SqlExecutor extends Executor {
return null;
}
LOGGER.info("Datasource {} currently has a pool of {} open connections!", connectionUrl, numberOfConnections); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Datasource {} currently has a pool of {} open connections!", connectionUrl, numberOfConnections); //$NON-NLS-1$
}
return connection;
}
......@@ -345,8 +346,8 @@ public class SqlExecutor extends Executor {
@Override
public void set(Variable<?> variable) {
parameters.put(variable.getName(), variable.getValue());
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Parameter -> {} = {}", variable.getName(), variable.getValue()); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Parameter -> {} = {}", variable.getName(), variable.getValue()); //$NON-NLS-1$
}
}
......@@ -373,8 +374,11 @@ public class SqlExecutor extends Executor {
columnTypes = this.getColumnTypes(rows);
columnValues = this.convertResults(rows);
elapsed = System.currentTimeMillis() - elapsed;
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Eval took {} ms | {}", elapsed, script); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Eval took {} ms | {}", elapsed, script); //$NON-NLS-1$
} else if (LOGGER.isInfoEnabled()) {
LOGGER.info("Eval took {} ms", elapsed); //$NON-NLS-1$
}
} catch (SQLException e) {
......@@ -433,8 +437,8 @@ public class SqlExecutor extends Executor {
vector.add(value);
}
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Result <- {} = {}", variable.getName(), variable.getValue()); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Result <- {} = {}", variable.getName(), variable.getValue()); //$NON-NLS-1$
}
variable.suspendListenerNotification(false);
......@@ -447,8 +451,8 @@ public class SqlExecutor extends Executor {
if (columnValues.size() > 0) {
Object[] values = columnValues.get(0);
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Result <- {} = {}", variable.getName(), values[index]); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Result <- {} = {}", variable.getName(), values[index]); //$NON-NLS-1$
}
variable.setValueFromObject(values[index]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment