IDEMPIERE-638 Check log level before calling logging method / s_log.finest

This commit is contained in:
Richard Morales 2013-02-21 13:00:23 -05:00
parent d2ed45fca1
commit ecbe68a1c7
5 changed files with 17 additions and 19 deletions

View File

@ -222,7 +222,7 @@ public class DefaultModelFactory implements IModelFactory {
String classTableName = clazz.getField("Table_Name").get(null).toString();
if (!tableName.equals(classTableName))
{
s_log.finest("Invalid class for table: " + className+" (tableName="+tableName+", classTableName="+classTableName+")");
if (s_log.isLoggable(Level.FINEST)) s_log.finest("Invalid class for table: " + className+" (tableName="+tableName+", classTableName="+classTableName+")");
return null;
}
}
@ -241,7 +241,7 @@ public class DefaultModelFactory implements IModelFactory {
catch (Exception e)
{
}
s_log.finest("Not found: " + className);
if (s_log.isLoggable(Level.FINEST)) s_log.finest("Not found: " + className);
return null;
} // getPOclass

View File

@ -172,7 +172,7 @@ public class MCost extends X_M_Cost
String cm = rs.getString(3);
percent = rs.getBigDecimal(4);
//M_CostElement_ID = rs.getInt(5);
s_log.finest("CurrentCostPrice=" + currentCostPrice
if (s_log.isLoggable(Level.FINEST)) s_log.finest("CurrentCostPrice=" + currentCostPrice
+ ", CurrentCostPriceLL=" + currentCostPriceLL
+ ", CostElementType=" + costElementType
+ ", CostingMethod=" + cm
@ -205,7 +205,7 @@ public class MCost extends X_M_Cost
}
if (count > 1) // Print summary
s_log.finest("MaterialCost=" + materialCostEach
if (s_log.isLoggable(Level.FINEST)) s_log.finest("MaterialCost=" + materialCostEach
+ ", OtherCosts=" + otherCostEach
+ ", Percentage=" + percentage);

View File

@ -154,12 +154,11 @@ public class MSequence extends X_AD_Sequence
pstmt.setQueryTimeout(QUERY_TIME_OUT);
}
rs = pstmt.executeQuery();
if (CLogMgt.isLevelFinest())
s_log.finest("AC=" + conn.getAutoCommit() + ", RO=" + conn.isReadOnly()
+ " - Isolation=" + conn.getTransactionIsolation() + "(" + Connection.TRANSACTION_READ_COMMITTED
+ ") - RSType=" + pstmt.getResultSetType() + "(" + ResultSet.TYPE_SCROLL_SENSITIVE
+ "), RSConcur=" + pstmt.getResultSetConcurrency() + "(" + ResultSet.CONCUR_UPDATABLE
+ ")");
if (s_log.isLoggable(Level.FINEST)) s_log.finest("AC=" + conn.getAutoCommit() + ", RO=" + conn.isReadOnly()
+ " - Isolation=" + conn.getTransactionIsolation() + "(" + Connection.TRANSACTION_READ_COMMITTED
+ ") - RSType=" + pstmt.getResultSetType() + "(" + ResultSet.TYPE_SCROLL_SENSITIVE
+ "), RSConcur=" + pstmt.getResultSetConcurrency() + "(" + ResultSet.CONCUR_UPDATABLE
+ ")");
if (rs.next())
{
@ -283,7 +282,7 @@ public class MSequence extends X_AD_Sequence
}
//s_log.finest (retValue + " - Table=" + TableName + " [" + trx + "]");
//if (s_log.isLoggable(Level.FINEST)) s_log.finest (retValue + " - Table=" + TableName + " [" + trx + "]");
return retValue;
} // getNextID

View File

@ -623,7 +623,7 @@ public class MPrintFormat extends X_AD_PrintFormat
if (pfi != null)
{
printFormatItemList.add (pfi);
s_log.finest("Tab: " + pfi);
if (s_log.isLoggable(Level.FINEST)) s_log.finest("Tab: " + pfi);
}
}
@ -844,7 +844,7 @@ public class MPrintFormat extends X_AD_PrintFormat
if (pfi != null)
{
list.add (pfi);
s_log.finest("Tab: " + pfi);
if (s_log.isLoggable(Level.FINEST)) s_log.finest("Tab: " + pfi);
}
}
}
@ -878,7 +878,7 @@ public class MPrintFormat extends X_AD_PrintFormat
if (pfi != null)
{
list.add (pfi);
s_log.finest("Table: " + pfi);
if (s_log.isLoggable(Level.FINEST)) s_log.finest("Table: " + pfi);
}
}
}
@ -962,7 +962,7 @@ public class MPrintFormat extends X_AD_PrintFormat
break;
counter += no;
} // for
s_log.finest("#" + counter);
if (s_log.isLoggable(Level.FINEST)) s_log.finest("#" + counter);
} // copyTranslationItems

View File

@ -58,7 +58,7 @@ public class Evaluator
}
String variable = logic.substring(first+1, second-1);
String eval = source.get_ValueAsString (variable);
s_log.finest(variable + "=" + eval);
if (s_log.isLoggable(Level.FINEST)) s_log.finest(variable + "=" + eval);
if (eval == null || eval.length() == 0)
return false;
//
@ -195,9 +195,8 @@ public class Evaluator
// Logical Comparison
boolean result = evaluateLogicTuple (firstEval, operand, secondEval);
//
if (CLogMgt.isLevelFinest())
s_log.finest(logic
+ " => \"" + firstEval + "\" " + operand + " \"" + secondEval + "\" => " + result);
if (s_log.isLoggable(Level.FINEST)) s_log.finest(logic
+ " => \"" + firstEval + "\" " + operand + " \"" + secondEval + "\" => " + result);
//
return result;
} // evaluateLogicTuple