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

View File

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

View File

@ -154,8 +154,7 @@ public class MSequence extends X_AD_Sequence
pstmt.setQueryTimeout(QUERY_TIME_OUT); pstmt.setQueryTimeout(QUERY_TIME_OUT);
} }
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (CLogMgt.isLevelFinest()) if (s_log.isLoggable(Level.FINEST)) s_log.finest("AC=" + conn.getAutoCommit() + ", RO=" + conn.isReadOnly()
s_log.finest("AC=" + conn.getAutoCommit() + ", RO=" + conn.isReadOnly()
+ " - Isolation=" + conn.getTransactionIsolation() + "(" + Connection.TRANSACTION_READ_COMMITTED + " - Isolation=" + conn.getTransactionIsolation() + "(" + Connection.TRANSACTION_READ_COMMITTED
+ ") - RSType=" + pstmt.getResultSetType() + "(" + ResultSet.TYPE_SCROLL_SENSITIVE + ") - RSType=" + pstmt.getResultSetType() + "(" + ResultSet.TYPE_SCROLL_SENSITIVE
+ "), RSConcur=" + pstmt.getResultSetConcurrency() + "(" + ResultSet.CONCUR_UPDATABLE + "), RSConcur=" + pstmt.getResultSetConcurrency() + "(" + ResultSet.CONCUR_UPDATABLE
@ -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; return retValue;
} // getNextID } // getNextID

View File

@ -623,7 +623,7 @@ public class MPrintFormat extends X_AD_PrintFormat
if (pfi != null) if (pfi != null)
{ {
printFormatItemList.add (pfi); 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) if (pfi != null)
{ {
list.add (pfi); 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) if (pfi != null)
{ {
list.add (pfi); 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; break;
counter += no; counter += no;
} // for } // for
s_log.finest("#" + counter); if (s_log.isLoggable(Level.FINEST)) s_log.finest("#" + counter);
} // copyTranslationItems } // copyTranslationItems

View File

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