From bd8d4521899cbb0a15b36e7b6f8c5474c55c81c4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 22 Feb 2013 09:57:32 -0500 Subject: [PATCH 1/8] IDEMPIERE-369 Master Detail layout improvements / Show the posting error on the breadcrumb --- .../org/adempiere/webui/adwindow/AbstractADWindowContent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index ebb2d6d2d2..d2d99e5883 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -2520,10 +2520,10 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements String error = AEnv.postImmediate (curWindowNo, Env.getAD_Client_ID(ctx), tableIdRef, recordIdRef, force); + onRefresh(true, false); + if (error != null) breadCrumb.setStatusLine(error, true); - - onRefresh(true, false); } } }); From 725d6fc305068f84b8bc65507e15018b590994e8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 22 Feb 2013 09:57:58 -0500 Subject: [PATCH 2/8] Add registration to scripts 201302221708_TICKET-1001758.sql --- migration/i1.0a-release/oracle/201302221708_TICKET-1001758.sql | 3 +++ .../i1.0a-release/postgresql/201302221708_TICKET-1001758.sql | 3 +++ 2 files changed, 6 insertions(+) diff --git a/migration/i1.0a-release/oracle/201302221708_TICKET-1001758.sql b/migration/i1.0a-release/oracle/201302221708_TICKET-1001758.sql index 2c1f721ce4..79c0e3e949 100644 --- a/migration/i1.0a-release/oracle/201302221708_TICKET-1001758.sql +++ b/migration/i1.0a-release/oracle/201302221708_TICKET-1001758.sql @@ -643,3 +643,6 @@ UPDATE C_Order SET IsPriviledgedRate='N' WHERE IsPriviledgedRate IS NULL UPDATE AD_Process_Para SET DefaultValue='@IsPriviledgedRate@',Updated=TO_DATE('2013-02-22 16:10:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200049 ; +SELECT register_migration_script('201302221708_TICKET-1001758.sql') FROM dual +; + diff --git a/migration/i1.0a-release/postgresql/201302221708_TICKET-1001758.sql b/migration/i1.0a-release/postgresql/201302221708_TICKET-1001758.sql index 25d9574320..2d1e72ac7d 100644 --- a/migration/i1.0a-release/postgresql/201302221708_TICKET-1001758.sql +++ b/migration/i1.0a-release/postgresql/201302221708_TICKET-1001758.sql @@ -643,3 +643,6 @@ UPDATE C_Order SET IsPriviledgedRate='N' WHERE IsPriviledgedRate IS NULL UPDATE AD_Process_Para SET DefaultValue='@IsPriviledgedRate@',Updated=TO_TIMESTAMP('2013-02-22 16:10:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200049 ; +SELECT register_migration_script('201302221708_TICKET-1001758.sql') FROM dual +; + From 9862bfb37f3c478f37c0c3192b19d3e0ddb009b9 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 22 Feb 2013 10:05:33 -0500 Subject: [PATCH 3/8] IDEMPIERE-372 Improve error messages --- org.adempiere.base/src/org/compiere/model/MCost.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MCost.java b/org.adempiere.base/src/org/compiere/model/MCost.java index 2f369d4e91..2f2a70d533 100644 --- a/org.adempiere.base/src/org/compiere/model/MCost.java +++ b/org.adempiere.base/src/org/compiere/model/MCost.java @@ -1672,7 +1672,7 @@ public class MCost extends X_M_Cost { if (CurrentQty.signum() < 0) { - throw new AverageCostingNegativeQtyException("Product(ID)="+getM_Product_ID()+", Current Qty="+getCurrentQty()+", New Current Qty="+CurrentQty + throw new AverageCostingNegativeQtyException("Product="+getM_Product().getName()+", Current Qty="+getCurrentQty()+", New Current Qty="+CurrentQty +", CostElement="+ce.getName()+", Schema="+getC_AcctSchema().getName()); } } From f364522dd52a10bca5735c7ae70e49e37dad0cfa Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 22 Feb 2013 15:13:14 -0500 Subject: [PATCH 4/8] IDEMPIERE-325 Complete AD based info window ( AD_InfoWindow ) implementation / hide double Grand Total column on Info Window --- .../i1.0a-release/oracle/201302221504_IDEMPIERE-325.sql | 8 ++++++++ .../postgresql/201302221504_IDEMPIERE-325.sql | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 migration/i1.0a-release/oracle/201302221504_IDEMPIERE-325.sql create mode 100644 migration/i1.0a-release/postgresql/201302221504_IDEMPIERE-325.sql diff --git a/migration/i1.0a-release/oracle/201302221504_IDEMPIERE-325.sql b/migration/i1.0a-release/oracle/201302221504_IDEMPIERE-325.sql new file mode 100644 index 0000000000..ddb8102159 --- /dev/null +++ b/migration/i1.0a-release/oracle/201302221504_IDEMPIERE-325.sql @@ -0,0 +1,8 @@ +-- Feb 22, 2013 3:02:16 PM COT +-- IDEMPIERE-325 Complete AD based info window ( AD_InfoWindow ) implementation +UPDATE AD_InfoColumn SET IsDisplayed='N',Updated=TO_DATE('2013-02-22 15:02:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200061 +; + +SELECT register_migration_script('201302221504_IDEMPIERE-325.sql') FROM dual +; + diff --git a/migration/i1.0a-release/postgresql/201302221504_IDEMPIERE-325.sql b/migration/i1.0a-release/postgresql/201302221504_IDEMPIERE-325.sql new file mode 100644 index 0000000000..a294fb7c1f --- /dev/null +++ b/migration/i1.0a-release/postgresql/201302221504_IDEMPIERE-325.sql @@ -0,0 +1,8 @@ +-- Feb 22, 2013 3:02:16 PM COT +-- IDEMPIERE-325 Complete AD based info window ( AD_InfoWindow ) implementation +UPDATE AD_InfoColumn SET IsDisplayed='N',Updated=TO_TIMESTAMP('2013-02-22 15:02:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200061 +; + +SELECT register_migration_script('201302221504_IDEMPIERE-325.sql') FROM dual +; + From b5102829f129b3261956d0948cabd26580f98f31 Mon Sep 17 00:00:00 2001 From: Richard Morales Date: Fri, 22 Feb 2013 15:43:26 -0500 Subject: [PATCH 5/8] IDEMPIERE-638 Check log level before calling logging method / s_log.finest+finer --- .../src/org/compiere/model/MArchive.java | 2 +- .../src/org/compiere/model/MCost.java | 36 +++++++++---------- .../model/MDepreciationConvention.java | 1 - .../src/org/compiere/model/MEntityType.java | 12 ++++--- .../org/compiere/model/MLookupFactory.java | 6 ++-- .../src/org/compiere/model/MSequence.java | 4 +-- .../src/org/compiere/model/SetGetUtil.java | 22 ++++++------ 7 files changed, 41 insertions(+), 42 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MArchive.java b/org.adempiere.base/src/org/compiere/model/MArchive.java index f5cf47594d..bb847d6d8b 100644 --- a/org.adempiere.base/src/org/compiere/model/MArchive.java +++ b/org.adempiere.base/src/org/compiere/model/MArchive.java @@ -76,7 +76,7 @@ public class MArchive extends X_AD_Archive { if (list.size() == 0) s_log.fine(sql.toString()); else - s_log.finer(sql.toString()); + if (s_log.isLoggable(Level.FINER)) s_log.finer(sql.toString()); // MArchive[] retValue = new MArchive[list.size()]; list.toArray(retValue); diff --git a/org.adempiere.base/src/org/compiere/model/MCost.java b/org.adempiere.base/src/org/compiere/model/MCost.java index 2f2a70d533..61b82fd621 100644 --- a/org.adempiere.base/src/org/compiere/model/MCost.java +++ b/org.adempiere.base/src/org/compiere/model/MCost.java @@ -221,7 +221,7 @@ public class MCost extends X_M_Cost // Standard costs - just Material Costs if (MCostElement.COSTINGMETHOD_StandardCosting.equals(costingMethod)) { - s_log.finer("MaterialCosts = " + materialCost); + if (s_log.isLoggable(Level.FINER)) s_log.finer("MaterialCosts = " + materialCost); return materialCost; } if (MCostElement.COSTINGMETHOD_Fifo.equals(costingMethod) @@ -240,7 +240,7 @@ public class MCost extends X_M_Cost if (costs.signum() == 0) return null; - s_log.finer("Sum Costs = " + costs); + if (s_log.isLoggable(Level.FINER)) s_log.finer("Sum Costs = " + costs); int precision = as.getCostingPrecision(); if (percentage.signum() == 0) // no percentages { @@ -254,7 +254,7 @@ public class MCost extends X_M_Cost costs = costs.add(percentCost); if (costs.scale() > precision) costs = costs.setScale(precision, BigDecimal.ROUND_HALF_UP); - s_log.finer("Sum Costs = " + costs + " (Add=" + percentCost + ")"); + if (s_log.isLoggable(Level.FINER)) s_log.finer("Sum Costs = " + costs + " (Add=" + percentCost + ")"); return costs; } // getCurrentCost @@ -502,7 +502,7 @@ public class MCost extends X_M_Cost if (retValue != null) { - s_log.finer(product.getName() + " = " + retValue); + if (s_log.isLoggable(Level.FINER)) s_log.finer(product.getName() + " = " + retValue); return retValue; } return null; @@ -565,7 +565,7 @@ public class MCost extends X_M_Cost if (retValue != null) { - s_log.finer(product.getName() + " = " + retValue); + if (s_log.isLoggable(Level.FINER)) s_log.finer(product.getName() + " = " + retValue); return retValue; } return null; @@ -617,7 +617,7 @@ public class MCost extends X_M_Cost if (retValue != null) { - s_log.finer(product.getName() + " = " + retValue); + if (s_log.isLoggable(Level.FINER)) s_log.finer(product.getName() + " = " + retValue); return retValue; } return null; @@ -864,7 +864,7 @@ public class MCost extends X_M_Cost BigDecimal matchQty = rs.getBigDecimal(2); if (matchQty == null) { - s_log.finer("Movement=" + movementQty + ", StockQty=" + newStockQty); + if (s_log.isLoggable(Level.FINER)) s_log.finer("Movement=" + movementQty + ", StockQty=" + newStockQty); continue; } // Assumption: everything is matched @@ -884,7 +884,7 @@ public class MCost extends X_M_Cost BigDecimal newAmt = averageCurrent.add(averageIncrease); newAmt = newAmt.setScale(as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP); newAverageAmt = newAmt.divide(newStockQty, as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP); - s_log.finer("Movement=" + movementQty + ", StockQty=" + newStockQty + if (s_log.isLoggable(Level.FINER)) s_log.finer("Movement=" + movementQty + ", StockQty=" + newStockQty + ", Match=" + matchQty + ", Cost=" + cost + ", NewAvg=" + newAverageAmt); } } @@ -900,7 +900,7 @@ public class MCost extends X_M_Cost // if (newAverageAmt != null && newAverageAmt.signum() != 0) { - s_log.finer(product.getName() + " = " + newAverageAmt); + if (s_log.isLoggable(Level.FINER)) s_log.finer(product.getName() + " = " + newAverageAmt); return newAverageAmt; } return null; @@ -958,7 +958,7 @@ public class MCost extends X_M_Cost BigDecimal matchQty = rs.getBigDecimal(2); if (matchQty == null) { - s_log.finer("Movement=" + movementQty + ", StockQty=" + newStockQty); + if (s_log.isLoggable(Level.FINER)) s_log.finer("Movement=" + movementQty + ", StockQty=" + newStockQty); continue; } // Assumption: everything is matched @@ -980,7 +980,7 @@ public class MCost extends X_M_Cost BigDecimal newAmt = averageCurrent.add(averageIncrease); newAmt = newAmt.setScale(as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP); newAverageAmt = newAmt.divide(newStockQty, as.getCostingPrecision(), BigDecimal.ROUND_HALF_UP); - s_log.finer("Movement=" + movementQty + ", StockQty=" + newStockQty + if (s_log.isLoggable(Level.FINER)) s_log.finer("Movement=" + movementQty + ", StockQty=" + newStockQty + ", Match=" + matchQty + ", Cost=" + cost + ", NewAvg=" + newAverageAmt); } } @@ -996,7 +996,7 @@ public class MCost extends X_M_Cost // if (newAverageAmt != null && newAverageAmt.signum() != 0) { - s_log.finer(product.getName() + " = " + newAverageAmt); + if (s_log.isLoggable(Level.FINER)) s_log.finer(product.getName() + " = " + newAverageAmt); return newAverageAmt; } return null; @@ -1082,7 +1082,7 @@ public class MCost extends X_M_Cost QtyCost pp = new QtyCost (movementQty, Env.ZERO); fifo.add(pp); } - s_log.finer("Movement=" + movementQty + ", Size=" + fifo.size()); + if (s_log.isLoggable(Level.FINER)) s_log.finer("Movement=" + movementQty + ", Size=" + fifo.size()); continue; } // Assumption: everything is matched @@ -1117,7 +1117,7 @@ public class MCost extends X_M_Cost QtyCost pp = new QtyCost (movementQty, cost); fifo.add(pp); } - s_log.finer("Movement=" + movementQty + ", Size=" + fifo.size()); + if (s_log.isLoggable(Level.FINER)) s_log.finer("Movement=" + movementQty + ", Size=" + fifo.size()); } } catch (SQLException e) @@ -1135,7 +1135,7 @@ public class MCost extends X_M_Cost return null; } QtyCost pp = (QtyCost)fifo.get(0); - s_log.finer(product.getName() + " = " + pp.Cost); + if (s_log.isLoggable(Level.FINER)) s_log.finer(product.getName() + " = " + pp.Cost); return pp.Cost; } // calculateFiFo @@ -1220,7 +1220,7 @@ public class MCost extends X_M_Cost QtyCost pp = new QtyCost (movementQty, Env.ZERO); lifo.add(pp); } - s_log.finer("Movement=" + movementQty + ", Size=" + lifo.size()); + if (s_log.isLoggable(Level.FINER)) s_log.finer("Movement=" + movementQty + ", Size=" + lifo.size()); continue; } // Assumption: everything is matched @@ -1236,7 +1236,7 @@ public class MCost extends X_M_Cost // QtyCost pp = new QtyCost (movementQty, cost); lifo.add(pp); - s_log.finer("Movement=" + movementQty + ", Size=" + lifo.size()); + if (s_log.isLoggable(Level.FINER)) s_log.finer("Movement=" + movementQty + ", Size=" + lifo.size()); } } catch (SQLException e) @@ -1254,7 +1254,7 @@ public class MCost extends X_M_Cost return null; } QtyCost pp = (QtyCost)lifo.get(lifo.size()-1); - s_log.finer(product.getName() + " = " + pp.Cost); + if (s_log.isLoggable(Level.FINER)) s_log.finer(product.getName() + " = " + pp.Cost); return pp.Cost; } // calculateLiFo diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java b/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java index f320202b2b..f7b72894f8 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java @@ -2,7 +2,6 @@ package org.compiere.model; import java.math.BigDecimal; import java.sql.CallableStatement; import java.sql.ResultSet; -import java.sql.SQLException; import java.util.Properties; import java.util.logging.Level; diff --git a/org.adempiere.base/src/org/compiere/model/MEntityType.java b/org.adempiere.base/src/org/compiere/model/MEntityType.java index 1b018b02fa..16edadf0fe 100644 --- a/org.adempiere.base/src/org/compiere/model/MEntityType.java +++ b/org.adempiere.base/src/org/compiere/model/MEntityType.java @@ -21,6 +21,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Properties; import java.util.StringTokenizer; +import java.util.logging.Level; + import static org.compiere.model.SystemIDs.*; import org.compiere.util.CLogger; @@ -44,7 +46,7 @@ public class MEntityType extends X_AD_EntityType /** * */ - private static final long serialVersionUID = 8906219523978497906L; + private static final long serialVersionUID = 4670009709141738924L; /** * Get Entity Types @@ -61,7 +63,7 @@ public class MEntityType extends X_AD_EntityType .list(); s_entityTypes = new MEntityType[list.size()]; list.toArray(s_entityTypes); - s_log.finer("# " + s_entityTypes.length); + if (s_log.isLoggable(Level.FINER)) s_log.finer("# " + s_entityTypes.length); return s_entityTypes; } // getEntityTypes @@ -99,7 +101,7 @@ public class MEntityType extends X_AD_EntityType list.add(s); retValue[i] = s; } - s_log.finer(list.toString()); + if (s_log.isLoggable(Level.FINER)) s_log.finer(list.toString()); return retValue; } // getEntityTypeStrings @@ -130,7 +132,7 @@ public class MEntityType extends X_AD_EntityType } String[] retValue = new String[list.size()]; list.toArray(retValue); - s_log.finer(list.toString()); + if (s_log.isLoggable(Level.FINER)) s_log.finer(list.toString()); return retValue; } // getClathpaths @@ -162,7 +164,7 @@ public class MEntityType extends X_AD_EntityType } String[] retValue = new String[list.size()]; list.toArray(retValue); - s_log.finer(list.toString()); + if (s_log.isLoggable(Level.FINER)) s_log.finer(list.toString()); return retValue; } // getModelPackages diff --git a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java index 8d64f8e15e..d2ae7d3c28 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java @@ -367,8 +367,7 @@ public class MLookupFactory MLookupInfo retValue = (MLookupInfo)s_cacheRefTable.get(key.toString()); if (retValue != null) { - if (s_log.isLoggable(Level.FINEST)) - s_log.finest("Cache: " + retValue); + if (s_log.isLoggable(Level.FINEST)) s_log.finest("Cache: " + retValue); return retValue.cloneIt(); } // @@ -556,8 +555,7 @@ public class MLookupFactory else realSQL.append(" ORDER BY 3"); - if (s_log.isLoggable(Level.FINEST)) - s_log.finest("AD_Reference_Value_ID=" + AD_Reference_Value_ID + " - " + realSQL); + if (s_log.isLoggable(Level.FINEST)) s_log.finest("AD_Reference_Value_ID=" + AD_Reference_Value_ID + " - " + realSQL); if (overrideZoomWindow > 0) { ZoomWindow = overrideZoomWindow; diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index 8c13c87dd0..a282c56e15 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -548,7 +548,7 @@ public class MSequence extends X_AD_Sequence if (suffix != null && suffix.length() > 0) doc.append(Env.parseVariable(suffix, po, trxName, false)); String documentNo = doc.toString(); - s_log.finer (documentNo + " (" + incrementNo + ")" + if (s_log.isLoggable(Level.FINER)) s_log.finer (documentNo + " (" + incrementNo + ")" + " - Sequence=" + AD_Sequence_ID + " [" + trx + "]"); return documentNo; } @@ -596,7 +596,7 @@ public class MSequence extends X_AD_Sequence MDocType dt = MDocType.get (Env.getCtx(), C_DocType_ID); // wrong for SERVER, but r/o if (dt != null && !dt.isDocNoControlled()) { - s_log.finer("DocType_ID=" + C_DocType_ID + " Not DocNo controlled"); + if (s_log.isLoggable(Level.FINER)) s_log.finer("DocType_ID=" + C_DocType_ID + " Not DocNo controlled"); return null; } if (definite && ! dt.isOverwriteSeqOnComplete()) { diff --git a/org.adempiere.base/src/org/compiere/model/SetGetUtil.java b/org.adempiere.base/src/org/compiere/model/SetGetUtil.java index c40e8bc6db..4366b354cd 100644 --- a/org.adempiere.base/src/org/compiere/model/SetGetUtil.java +++ b/org.adempiere.base/src/org/compiere/model/SetGetUtil.java @@ -28,10 +28,10 @@ import java.sql.Timestamp; import java.util.ArrayList; import java.util.Collection; import java.util.Properties; +import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; import org.adempiere.exceptions.DBException; -import org.compiere.util.CLogMgt; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; @@ -120,7 +120,7 @@ public class SetGetUtil { for (SetGetModel model : models) { - if(CLogMgt.isLevelFinest()) s_log.finest("Model: " + model); + if (s_log.isLoggable(Level.FINEST)) s_log.finest("Model: " + model); if (rs.next()) { if (columnNames == null) @@ -149,12 +149,12 @@ public class SetGetUtil } // ok = model.set_AttrValue(columnName, obj); - if (CLogMgt.isLevelFinest()) s_log.finest("columnName=" + columnName + ", value=[" + obj + "][" + (obj != null ? obj.getClass().getName() : "null") + "], ok=" + ok); + if (s_log.isLoggable(Level.FINEST)) s_log.finest("columnName=" + columnName + ", value=[" + obj + "][" + (obj != null ? obj.getClass().getName() : "null") + "], ok=" + ok); } } else { - s_log.finest("@NoResult@"); + if (s_log.isLoggable(Level.FINEST)) s_log.finest("@NoResult@"); break; } } @@ -234,7 +234,7 @@ public class SetGetUtil String[] includeFields, String[] excludeFields, boolean trackOnlyChanges) { - if (CLogMgt.isLevelFinest()) + if (s_log.isLoggable(Level.FINEST)) { s_log.finest("Entering: From=" + from+ " - To=" + to); // s_log.finest("includeFields=" + ARHIPAC.toString(includeFields)); @@ -243,7 +243,7 @@ public class SetGetUtil // if (to == null || from == null) { - if (CLogMgt.isLevelFinest()) + if (s_log.isLoggable(Level.FINEST)) { s_log.finest("Leaving: to == null || from == null"); Thread.dumpStack(); @@ -308,19 +308,19 @@ public class SetGetUtil //- if (isExcluded) { - if (CLogMgt.isLevelFinest()) s_log.finest("Field " + colName + " [SKIP:excluded]"); + if (s_log.isLoggable(Level.FINEST)) s_log.finest("Field " + colName + " [SKIP:excluded]"); continue; } int idx_to = to.get_ColumnIndex(colName); if (idx_to < 0) { - if (CLogMgt.isLevelFinest()) s_log.finest("Field " + colName + " [SKIP:idx_to < 0]"); + if (s_log.isLoggable(Level.FINEST)) s_log.finest("Field " + colName + " [SKIP:idx_to < 0]"); continue; } if (to.p_info.isVirtualColumn(idx_to) || to.p_info.isKey(idx_to)) { // KeyColumn - if (CLogMgt.isLevelFinest()) s_log.finest("Field " + colName + " [SKIP:virtual or key]"); + if (s_log.isLoggable(Level.FINEST)) s_log.finest("Field " + colName + " [SKIP:virtual or key]"); continue; } @@ -331,10 +331,10 @@ public class SetGetUtil { copiedFields++; } - if (CLogMgt.isLevelFinest()) s_log.finest("Field " + colName + "=[" + value + "], idx=" + idx_from + "->" + idx_to); + if (s_log.isLoggable(Level.FINEST)) s_log.finest("Field " + colName + "=[" + value + "], idx=" + idx_from + "->" + idx_to); } // - if (CLogMgt.isLevelFinest()) s_log.finest("Leaving: to=" + to); + if (s_log.isLoggable(Level.FINEST)) s_log.finest("Leaving: to=" + to); return copiedFields; } // copyValues From 7c53aa5f4df5792581d23c159030c25f4701934b Mon Sep 17 00:00:00 2001 From: Richard Morales Date: Fri, 22 Feb 2013 15:50:25 -0500 Subject: [PATCH 6/8] IDEMPIERE-638 Check log level before calling logging method / s_log.fine --- .../compiere/process/DocumentTypeVerify.java | 2 +- .../org/compiere/process/SequenceCheck.java | 4 ++-- .../src/org/adempiere/base/Core.java | 6 ++---- .../adempiere/base/DefaultModelFactory.java | 2 +- .../src/org/compiere/acct/Doc_Order.java | 4 ++-- .../src/org/compiere/model/MAccount.java | 4 ++-- .../compiere/model/MAcctSchemaElement.java | 4 ++-- .../org/compiere/model/MAssetAddition.java | 7 ++++--- .../src/org/compiere/model/MAssetChange.java | 5 +++-- .../src/org/compiere/model/MAttribute.java | 3 ++- .../compiere/model/MAttributeSetInstance.java | 4 ++-- .../compiere/model/MBankAccountProcessor.java | 2 +- .../org/compiere/model/MContactInterest.java | 5 +++-- .../compiere/model/MConversionRateUtil.java | 4 ++-- .../src/org/compiere/model/MCost.java | 18 +++++++++--------- .../src/org/compiere/model/MCostQueue.java | 8 ++++---- .../src/org/compiere/model/MCountry.java | 2 +- .../src/org/compiere/model/MDepreciation.java | 9 +++++---- .../org/compiere/model/MDepreciationExp.java | 3 ++- .../src/org/compiere/model/MFactAcct.java | 2 +- .../src/org/compiere/model/MInvoiceTax.java | 5 +++-- .../src/org/compiere/model/MLookupCache.java | 5 +++-- .../org/compiere/model/MLookupFactory.java | 9 +++------ .../src/org/compiere/model/MOrderLine.java | 2 +- .../src/org/compiere/model/MOrderTax.java | 4 ++-- .../compiere/model/MPaySelectionCheck.java | 8 ++++---- .../org/compiere/model/MPaymentValidate.java | 19 ++++++++++--------- .../org/compiere/model/MProductCategory.java | 2 +- .../src/org/compiere/model/MQuery.java | 2 +- .../src/org/compiere/model/MRMATax.java | 4 ++-- .../src/org/compiere/model/MRegion.java | 2 +- .../src/org/compiere/model/MSequence.java | 4 ++-- .../org/compiere/model/MStorageOnHand.java | 8 ++++---- .../compiere/model/MStorageReservation.java | 8 ++++---- .../org/compiere/model/MUOMConversion.java | 6 +++--- .../org/compiere/model/MWarehousePrice.java | 4 ++-- .../src/org/compiere/model/PO.java | 2 +- 37 files changed, 98 insertions(+), 94 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/DocumentTypeVerify.java b/org.adempiere.base.process/src/org/compiere/process/DocumentTypeVerify.java index 7b0934dea9..370e7a8ad8 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DocumentTypeVerify.java +++ b/org.adempiere.base.process/src/org/compiere/process/DocumentTypeVerify.java @@ -174,7 +174,7 @@ public class DocumentTypeVerify extends SvrProcess if (pc.save()) { counter++; - s_log.fine(pc.toString()); + if (s_log.isLoggable(Level.FINE)) s_log.fine(pc.toString()); } else s_log.warning("Not saved: " + pc); diff --git a/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java b/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java index 6083b14f84..278df7c77c 100644 --- a/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java +++ b/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java @@ -147,7 +147,7 @@ public class SequenceCheck extends SvrProcess sp.addLog(0, null, null,msglog.toString()); } else - s_log.fine("Sync #" + no); + if (s_log.isLoggable(Level.FINE)) s_log.fine("Sync #" + no); } if (no >= 0) return; @@ -239,7 +239,7 @@ public class SequenceCheck extends SvrProcess DB.close(rs, pstmt); rs = null; pstmt = null; } - s_log.fine("#" + counter); + if (s_log.isLoggable(Level.FINE)) s_log.fine("#" + counter); } // checkTableID diff --git a/org.adempiere.base/src/org/adempiere/base/Core.java b/org.adempiere.base/src/org/adempiere/base/Core.java index c15d03777b..1418bf9082 100644 --- a/org.adempiere.base/src/org/adempiere/base/Core.java +++ b/org.adempiere.base/src/org/adempiere/base/Core.java @@ -136,8 +136,7 @@ public class Core { * @return initialized PaymentProcessor or null */ public static PaymentProcessor getPaymentProcessor(MBankAccountProcessor mbap, PaymentInterface mp) { - if (s_log.isLoggable(Level.FINE)) - s_log.fine("create for " + mbap); + if (s_log.isLoggable(Level.FINE)) s_log.fine("create for " + mbap); MPaymentProcessor mpp = new MPaymentProcessor(mbap.getCtx(), mbap.getC_PaymentProcessor_ID(), mbap.get_TrxName()); String className = mpp.getPayProcessorClass(); @@ -177,8 +176,7 @@ public class Core { */ public static IShipmentProcessor getShipmentProcessor(MShipperFacade sf) { - if (s_log.isLoggable(Level.FINE)) - s_log.fine("create for " + sf); + if (s_log.isLoggable(Level.FINE)) s_log.fine("create for " + sf); String className = sf.getShippingProcessorClass(); if (className == null || className.length() == 0) diff --git a/org.adempiere.base/src/org/adempiere/base/DefaultModelFactory.java b/org.adempiere.base/src/org/adempiere/base/DefaultModelFactory.java index e703749398..8a48f6c49e 100644 --- a/org.adempiere.base/src/org/adempiere/base/DefaultModelFactory.java +++ b/org.adempiere.base/src/org/adempiere/base/DefaultModelFactory.java @@ -232,7 +232,7 @@ public class DefaultModelFactory implements IModelFactory { { if (superClazz == PO.class) { - s_log.fine("Use: " + className); + if (s_log.isLoggable(Level.FINE)) s_log.fine("Use: " + className); return clazz; } superClazz = superClazz.getSuperclass(); diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Order.java b/org.adempiere.base/src/org/compiere/acct/Doc_Order.java index 50a9322f0a..0fa93b74ce 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Order.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Order.java @@ -556,7 +556,7 @@ public class Doc_Order extends Doc if (!tax.isZeroTax()) { BigDecimal LineNetAmtTax = tax.calculateTax(LineNetAmt, true, precision); - s_log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax); + if (s_log.isLoggable(Level.FINE)) s_log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax); LineNetAmt = LineNetAmt.subtract(LineNetAmtTax); BigDecimal PriceListTax = tax.calculateTax(PriceList, true, precision); PriceList = PriceList.subtract(PriceListTax); @@ -697,7 +697,7 @@ public class Doc_Order extends Doc if (!tax.isZeroTax()) { BigDecimal LineNetAmtTax = tax.calculateTax(LineNetAmt, true, precision); - s_log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax); + if (s_log.isLoggable(Level.FINE)) s_log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax); LineNetAmt = LineNetAmt.subtract(LineNetAmtTax); BigDecimal PriceListTax = tax.calculateTax(PriceList, true, precision); PriceList = PriceList.subtract(PriceListTax); diff --git a/org.adempiere.base/src/org/compiere/model/MAccount.java b/org.adempiere.base/src/org/compiere/model/MAccount.java index 75895fc10c..15d1e5208f 100644 --- a/org.adempiere.base/src/org/compiere/model/MAccount.java +++ b/org.adempiere.base/src/org/compiere/model/MAccount.java @@ -227,7 +227,7 @@ public class MAccount extends X_C_ValidCombination s_log.log(Level.SEVERE, "Could not create new account - " + info); return null; } - s_log.fine("New: " + newAccount); + if (s_log.isLoggable(Level.FINE)) s_log.fine("New: " + newAccount); return newAccount; } // get @@ -330,7 +330,7 @@ public class MAccount extends X_C_ValidCombination else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_UserElement2) && setValue) vc.setUserElement2_ID(defaultValue); } - s_log.fine("Client_ID=" + if (s_log.isLoggable(Level.FINE)) s_log.fine("Client_ID=" + vc.getAD_Client_ID() + ", Org_ID=" + vc.getAD_Org_ID() + " - AcctSchema_ID=" + vc.getC_AcctSchema_ID() + ", Account_ID=" + vc.getAccount_ID()); return vc; diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java index b9fd67fbb5..17c596889b 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java @@ -60,7 +60,7 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element if (retValue != null) return retValue; - s_log.fine("C_AcctSchema_ID=" + as.getC_AcctSchema_ID()); + if (s_log.isLoggable(Level.FINE)) s_log.fine("C_AcctSchema_ID=" + as.getC_AcctSchema_ID()); ArrayList list = new ArrayList(); final String whereClause = "C_AcctSchema_ID=? AND IsActive=?"; @@ -71,7 +71,7 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element for(MAcctSchemaElement ase : elements) { - s_log.fine(" - " + ase); + if (s_log.isLoggable(Level.FINE)) s_log.fine(" - " + ase); if (ase.isMandatory() && ase.getDefaultValue() == 0) s_log.log(Level.SEVERE, "No default value for " + ase.getName()); list.add(ase); diff --git a/org.adempiere.base/src/org/compiere/model/MAssetAddition.java b/org.adempiere.base/src/org/compiere/model/MAssetAddition.java index 065b8c4b6c..d9e2c39117 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetAddition.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetAddition.java @@ -6,6 +6,7 @@ import java.sql.ResultSet; import java.sql.Timestamp; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import org.adempiere.exceptions.FillMandatoryException; import org.compiere.process.DocAction; @@ -35,11 +36,11 @@ import org.idempiere.fa.util.POCacheLocal; public class MAssetAddition extends X_A_Asset_Addition implements DocAction { - /** * */ private static final long serialVersionUID = 5977180589101094202L; + /** Static Logger */ private static CLogger s_log = CLogger.getCLogger(MAssetAddition.class); @@ -386,7 +387,7 @@ public class MAssetAddition extends X_A_Asset_Addition } - if(CLogMgt.isLevelFine()) s_log.fine("Entering: model=" + model + ", M_MatchInv_ID=" + M_MatchInv_ID + ", newRecord=" + newRecord + ", trxName=" + trxName); + if (s_log.isLoggable(Level.FINE)) s_log.fine("Entering: model=" + model + ", M_MatchInv_ID=" + M_MatchInv_ID + ", newRecord=" + newRecord + ", trxName=" + trxName); final String qMatchInv_select = "SELECT" + " C_Invoice_ID" @@ -435,7 +436,7 @@ public class MAssetAddition extends X_A_Asset_Addition */ SetGetUtil.updateColumns(model, null, query, trxName); - if(CLogMgt.isLevelFine()) s_log.fine("Leaving: RETURN TRUE"); + s_log.fine("Leaving: RETURN TRUE"); return true; } diff --git a/org.adempiere.base/src/org/compiere/model/MAssetChange.java b/org.adempiere.base/src/org/compiere/model/MAssetChange.java index 19cb4b6218..3270c53b71 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetChange.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetChange.java @@ -15,6 +15,7 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; +import java.util.logging.Level; import org.compiere.model.MRefList; import org.compiere.model.PO; @@ -103,7 +104,7 @@ public class MAssetChange extends X_A_Asset_Change } public static MAssetChange create(Properties ctx, String changeType, PO[] pos, boolean save, String trxName) { - s_log.fine("Entering: changeType=" + changeType); + if (s_log.isLoggable(Level.FINE)) s_log.fine("Entering: changeType=" + changeType); if (pos == null || pos.length == 0) { s_log.fine("Entering/Leaving: POs is empty"); return null; @@ -117,7 +118,7 @@ public class MAssetChange extends X_A_Asset_Change change.saveEx(); } // - s_log.fine("Leaving: change=" + change); + if (s_log.isLoggable(Level.FINE)) s_log.fine("Leaving: change=" + change); return change; } diff --git a/org.adempiere.base/src/org/compiere/model/MAttribute.java b/org.adempiere.base/src/org/compiere/model/MAttribute.java index df0e71573a..edcbc2df6c 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttribute.java +++ b/org.adempiere.base/src/org/compiere/model/MAttribute.java @@ -21,6 +21,7 @@ import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import org.compiere.util.CLogger; import org.compiere.util.DB; @@ -74,7 +75,7 @@ public class MAttribute extends X_M_Attribute MAttribute[] retValue = new MAttribute[list.size ()]; list.toArray (retValue); - s_log.fine("AD_Client_ID=" + AD_Client_ID + " - #" + list.size()); + if (s_log.isLoggable(Level.FINE)) s_log.fine("AD_Client_ID=" + AD_Client_ID + " - #" + list.size()); return retValue; } // getOfClient diff --git a/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java b/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java index f7bb33a670..d52ff1446c 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java +++ b/org.adempiere.base/src/org/compiere/model/MAttributeSetInstance.java @@ -61,11 +61,11 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance // Load Instance if not 0 if (M_AttributeSetInstance_ID != 0) { - s_log.fine("From M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID); + if (s_log.isLoggable(Level.FINE)) s_log.fine("From M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID); return new MAttributeSetInstance (ctx, M_AttributeSetInstance_ID, null); } // Get new from Product - s_log.fine("From M_Product_ID=" + M_Product_ID); + if (s_log.isLoggable(Level.FINE)) s_log.fine("From M_Product_ID=" + M_Product_ID); if (M_Product_ID == 0) return null; String sql = "SELECT M_AttributeSet_ID, M_AttributeSetInstance_ID " diff --git a/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java b/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java index d10a02434e..5e2ff72f5e 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/MBankAccountProcessor.java @@ -122,7 +122,7 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor { s_log.warning("find - not found - AD_Client_ID=" + AD_Client_ID + ", C_Currency_ID=" + C_Currency_ID + ", Amt=" + Amt); else - s_log.fine("find - #" + list.size() + " - AD_Client_ID=" + AD_Client_ID + if (s_log.isLoggable(Level.FINE)) s_log.fine("find - #" + list.size() + " - AD_Client_ID=" + AD_Client_ID + ", C_Currency_ID=" + C_Currency_ID + ", Amt=" + Amt); MBankAccountProcessor[] retValue = new MBankAccountProcessor[list.size()]; list.toArray(retValue); diff --git a/org.adempiere.base/src/org/compiere/model/MContactInterest.java b/org.adempiere.base/src/org/compiere/model/MContactInterest.java index 78abb650d7..7de2cc8cff 100644 --- a/org.adempiere.base/src/org/compiere/model/MContactInterest.java +++ b/org.adempiere.base/src/org/compiere/model/MContactInterest.java @@ -19,6 +19,7 @@ package org.compiere.model; import java.sql.ResultSet; import java.sql.Timestamp; import java.util.Properties; +import java.util.logging.Level; import org.compiere.util.CLogger; import org.compiere.util.Env; @@ -62,10 +63,10 @@ public class MContactInterest extends X_R_ContactInterest { retValue = new MContactInterest (ctx, R_InterestArea_ID, AD_User_ID, isActive, trxName); - s_log.fine("NOT found - " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine("NOT found - " + retValue); } else - s_log.fine("Found - " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine("Found - " + retValue); return retValue; } // get diff --git a/org.adempiere.base/src/org/compiere/model/MConversionRateUtil.java b/org.adempiere.base/src/org/compiere/model/MConversionRateUtil.java index 7ebf89f471..0f76abb32f 100644 --- a/org.adempiere.base/src/org/compiere/model/MConversionRateUtil.java +++ b/org.adempiere.base/src/org/compiere/model/MConversionRateUtil.java @@ -6,8 +6,8 @@ package org.compiere.model; import java.math.BigDecimal; import java.math.RoundingMode; import java.sql.Timestamp; +import java.util.logging.Level; -import org.compiere.util.CLogMgt; import org.compiere.util.CLogger; import org.compiere.util.Env; import org.idempiere.exceptions.NoCurrencyConversionException; @@ -97,7 +97,7 @@ public final class MConversionRateUtil if (AmtName != null) model.set_AttrValue(AmtName, amt); // Return amt - if (CLogMgt.isLevelFine()) s_log.fine("amt=" + sourceAmt + " * " + rate + "=" + amt + ", scale=" + stdPrecision); + if (s_log.isLoggable(Level.FINE)) s_log.fine("amt=" + sourceAmt + " * " + rate + "=" + amt + ", scale=" + stdPrecision); return amt; } // convert } diff --git a/org.adempiere.base/src/org/compiere/model/MCost.java b/org.adempiere.base/src/org/compiere/model/MCost.java index 61b82fd621..d966136a51 100644 --- a/org.adempiere.base/src/org/compiere/model/MCost.java +++ b/org.adempiere.base/src/org/compiere/model/MCost.java @@ -296,7 +296,7 @@ public class MCost extends X_M_Cost throw new IllegalArgumentException("Unknown Costing Method = " + costingMethod); if (retValue != null && retValue.signum() > 0) { - s_log.fine(product.getName() + ", CostingMethod=" + costingMethod + " - " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", CostingMethod=" + costingMethod + " - " + retValue); return retValue; } @@ -306,7 +306,7 @@ public class MCost extends X_M_Cost retValue = getPOPrice(product, C_OrderLine_ID, as.getC_Currency_ID()); if (retValue != null && retValue.signum() > 0) { - s_log.fine(product.getName() + ", PO - " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", PO - " + retValue); return retValue; } } @@ -318,7 +318,7 @@ public class MCost extends X_M_Cost MCost cost = get(product, M_ASI_ID, as, Org_ID, ce.getM_CostElement_ID(), product.get_TrxName()); if (cost != null && cost.getCurrentCostPrice().signum() > 0) { - s_log.fine(product.getName() + ", Standard - " + cost); + if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", Standard - " + cost); return cost.getCurrentCostPrice(); } } @@ -334,7 +334,7 @@ public class MCost extends X_M_Cost retValue = getLastPOPrice(product, M_ASI_ID, 0, as.getC_Currency_ID()); if (retValue != null && retValue.signum() > 0) { - s_log.fine(product.getName() + ", LastPO = " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", LastPO = " + retValue); return retValue; } } @@ -346,7 +346,7 @@ public class MCost extends X_M_Cost retValue = getLastInvoicePrice(product, M_ASI_ID, 0, as.getC_Currency_ID()); if (retValue != null && retValue.signum() != 0) { - s_log.fine(product.getName() + ", LastInv = " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", LastInv = " + retValue); return retValue; } } @@ -362,7 +362,7 @@ public class MCost extends X_M_Cost retValue = getLastInvoicePrice(product, M_ASI_ID, 0, as.getC_Currency_ID()); if (retValue != null && retValue.signum() > 0) { - s_log.fine(product.getName() + ", LastInv = " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", LastInv = " + retValue); return retValue; } } @@ -374,7 +374,7 @@ public class MCost extends X_M_Cost retValue = getLastPOPrice(product, M_ASI_ID, 0, as.getC_Currency_ID()); if (retValue != null && retValue.signum() > 0) { - s_log.fine(product.getName() + ", LastPO = " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", LastPO = " + retValue); return retValue; } } @@ -402,7 +402,7 @@ public class MCost extends X_M_Cost if (price != null && price.signum() != 0) { retValue = price; - s_log.fine(product.getName() + ", Product_PO = " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", Product_PO = " + retValue); return retValue; } } @@ -415,7 +415,7 @@ public class MCost extends X_M_Cost retValue = price; } - s_log.fine(product.getName() + " = " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + " = " + retValue); return retValue; } // getSeedCosts diff --git a/org.adempiere.base/src/org/compiere/model/MCostQueue.java b/org.adempiere.base/src/org/compiere/model/MCostQueue.java index 1720e47cfb..6f2aaa21aa 100644 --- a/org.adempiere.base/src/org/compiere/model/MCostQueue.java +++ b/org.adempiere.base/src/org/compiere/model/MCostQueue.java @@ -184,7 +184,7 @@ public class MCostQueue extends X_M_CostQueue queue.setCurrentQty(newQty); if (queue.save()) { - s_log.fine("Qty=" + remainingQty + if (s_log.isLoggable(Level.FINE)) s_log.fine("Qty=" + remainingQty + "(!), ASI=" + queue.getM_AttributeSetInstance_ID() + " - " + oldQty + " -> " + newQty); return queue.getCurrentCostPrice(); @@ -204,7 +204,7 @@ public class MCostQueue extends X_M_CostQueue queue.setCurrentQty(newQty); if (queue.save()) { - s_log.fine("Qty=" + reduction + if (s_log.isLoggable(Level.FINE)) s_log.fine("Qty=" + reduction + ", ASI=" + queue.getM_AttributeSetInstance_ID() + " - " + oldQty + " -> " + newQty); remainingQty = remainingQty.subtract(reduction); @@ -219,7 +219,7 @@ public class MCostQueue extends X_M_CostQueue } } // for queue - s_log.fine("RemainingQty=" + remainingQty); + if (s_log.isLoggable(Level.FINE)) s_log.fine("RemainingQty=" + remainingQty); return null; } // adjustQty @@ -275,7 +275,7 @@ public class MCostQueue extends X_M_CostQueue lastPrice = queue.getCurrentCostPrice(); BigDecimal costBatch = lastPrice.multiply(reduction); cost = cost.add(costBatch); - s_log.fine("ASI=" + queue.getM_AttributeSetInstance_ID() + if (s_log.isLoggable(Level.FINE)) s_log.fine("ASI=" + queue.getM_AttributeSetInstance_ID() + " - Cost=" + lastPrice + " * Qty=" + reduction + " = " + costBatch); remainingQty = remainingQty.subtract(reduction); // Done diff --git a/org.adempiere.base/src/org/compiere/model/MCountry.java b/org.adempiere.base/src/org/compiere/model/MCountry.java index 2f1b0f1a3d..2531b2a4ec 100644 --- a/org.adempiere.base/src/org/compiere/model/MCountry.java +++ b/org.adempiere.base/src/org/compiere/model/MCountry.java @@ -142,7 +142,7 @@ public final class MCountry extends X_C_Country } if (s_default == null) s_default = usa; - s_log.fine("#" + s_countries.size() + if (s_log.isLoggable(Level.FINE)) s_log.fine("#" + s_countries.size() + " - Default=" + s_default); } // loadAllCountries diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciation.java b/org.adempiere.base/src/org/compiere/model/MDepreciation.java index 0dbbcd4510..e1dddff16e 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciation.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciation.java @@ -3,6 +3,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.sql.ResultSet; import java.util.Properties; +import java.util.logging.Level; import java.util.logging.Logger; import org.compiere.model.Query; @@ -372,7 +373,7 @@ public class MDepreciation extends X_A_Depreciation amt_sl = amt_r.divide(new BigDecimal(A_RemainingLife_Year), getPrecision(), RoundingMode.HALF_UP); // logging if (CLogMgt.isLevelFinest()) { - s_log.fine("amt_r=" + amt_r + ", amt_ad1=amt_r*coef_ad1=" + amt_ad1 + ", amt_sl=amt_r/A_RemainingLife_Year=" + amt_sl + ", A_Current_Year=" + A_Current_Year + ", A_RemainingLife_Year=" + A_RemainingLife_Year); + if (s_log.isLoggable(Level.FINE)) s_log.fine("amt_r=" + amt_r + ", amt_ad1=amt_r*coef_ad1=" + amt_ad1 + ", amt_sl=amt_r/A_RemainingLife_Year=" + amt_sl + ", A_Current_Year=" + A_Current_Year + ", A_RemainingLife_Year=" + A_RemainingLife_Year); } /** If the first year or if the value depreciation value depreciation degressive more linear ... */ @@ -382,7 +383,7 @@ public class MDepreciation extends X_A_Depreciation else { amtPerYear = amt_sl; is_SL = true; - s_log.fine("*** PASS IT ON linear amt_sl= " + amt_sl + " ***"); + if (s_log.isLoggable(Level.FINE)) s_log.fine("*** PASS IT ON linear amt_sl= " + amt_sl + " ***"); } } else { @@ -391,9 +392,9 @@ public class MDepreciation extends X_A_Depreciation } amt_r = amt_r.subtract(amtPerYear); - if (CLogMgt.isLevelFinest()) s_log.fine("year=" + curr_year + ", amtPerYear=" + amtPerYear + ", amt_r=" + amt_r); //logging + if (s_log.isLoggable(Level.FINE)) s_log.fine("year=" + curr_year + ", amtPerYear=" + amtPerYear + ", amt_r=" + amt_r); //logging } - if (CLogMgt.isLevelFinest()) s_log.fine("amt_r=" + amt_r + ", amtPerYear=" + amtPerYear); //logging + if (s_log.isLoggable(Level.FINE)) s_log.fine("amt_r=" + amt_r + ", amtPerYear=" + amtPerYear); //logging /** Damping value for the current month */ BigDecimal assetExp = getPeriodExp(A_Current_Period, amtPerYear); diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationExp.java b/org.adempiere.base/src/org/compiere/model/MDepreciationExp.java index 9b7c694330..a25e039b0d 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationExp.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationExp.java @@ -7,6 +7,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import org.compiere.model.MDocType; import org.compiere.model.MPeriod; @@ -94,7 +95,7 @@ public class MDepreciationExp extends X_A_Depreciation_Exp // depexp.updateFrom(assetwk); // - s_log.fine("depexp=" + depexp); + if (s_log.isLoggable(Level.FINE)) s_log.fine("depexp=" + depexp); return depexp; } diff --git a/org.adempiere.base/src/org/compiere/model/MFactAcct.java b/org.adempiere.base/src/org/compiere/model/MFactAcct.java index 9fa427a221..7bb0bccd06 100644 --- a/org.adempiere.base/src/org/compiere/model/MFactAcct.java +++ b/org.adempiere.base/src/org/compiere/model/MFactAcct.java @@ -75,7 +75,7 @@ public class MFactAcct extends X_Fact_Acct { final String sql = "DELETE Fact_Acct WHERE AD_Table_ID=? AND Record_ID=?"; int no = DB.executeUpdateEx(sql, new Object[]{AD_Table_ID, Record_ID}, trxName); - s_log.fine("delete - AD_Table_ID=" + AD_Table_ID + ", Record_ID=" + Record_ID + " - #" + no); + if (s_log.isLoggable(Level.FINE)) s_log.fine("delete - AD_Table_ID=" + AD_Table_ID + ", Record_ID=" + Record_ID + " - #" + no); return no; } diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java b/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java index d95309ef72..c2bb67f449 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceTax.java @@ -21,6 +21,7 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Properties; +import java.util.logging.Level; import org.adempiere.exceptions.DBException; import org.compiere.util.CLogger; @@ -80,7 +81,7 @@ public class MInvoiceTax extends X_C_InvoiceTax { retValue.set_TrxName(trxName); retValue.setPrecision(precision); - s_log.fine("(old=" + oldTax + ") " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine("(old=" + oldTax + ") " + retValue); return retValue; } // If the old tax was required and there is no MInvoiceTax for that @@ -98,7 +99,7 @@ public class MInvoiceTax extends X_C_InvoiceTax retValue.setC_Tax_ID(line.getC_Tax_ID()); retValue.setPrecision(precision); retValue.setIsTaxIncluded(line.isTaxIncluded()); - s_log.fine("(new) " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine("(new) " + retValue); return retValue; } // get diff --git a/org.adempiere.base/src/org/compiere/model/MLookupCache.java b/org.adempiere.base/src/org/compiere/model/MLookupCache.java index a4ea9619f8..682a8e1ef7 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupCache.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupCache.java @@ -19,6 +19,7 @@ package org.compiere.model; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import java.util.logging.Level; import org.compiere.util.CCache; import org.compiere.util.CLogger; @@ -115,7 +116,7 @@ public class MLookupCache lookupTarget.put(cacheKey, cacheData); } - s_log.fine("#" + lookupTarget.size()); + if (s_log.isLoggable(Level.FINE)) s_log.fine("#" + lookupTarget.size()); return true; } // loadFromCache @@ -141,7 +142,7 @@ public class MLookupCache for (int i = 0; i < toDelete.size(); i++) s_loadedLookups.remove(toDelete.get(i)); int endNo = s_loadedLookups.size(); - s_log.fine("WindowNo=" + WindowNo + if (s_log.isLoggable(Level.FINE)) s_log.fine("WindowNo=" + WindowNo + " - " + startNo + " -> " + endNo); } // cacheReset diff --git a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java index d2ae7d3c28..4f1fb4fa1f 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java @@ -217,8 +217,7 @@ public class MLookupFactory return null; } info.Query = newSQL; - if (s_log.isLoggable(Level.FINE)) - s_log.fine("getLookupInfo, newSQL ="+newSQL); //jz + if (s_log.isLoggable(Level.FINE)) s_log.fine("getLookupInfo, newSQL ="+newSQL); //jz } // Direct Query - NO Validation/Security @@ -231,8 +230,7 @@ public class MLookupFactory return null; } info.QueryDirect = newSQL; - if (s_log.isLoggable(Level.FINE)) - s_log.fine("getLookupInfo, newSQL ="+newSQL); //jz + if (s_log.isLoggable(Level.FINE)) s_log.fine("getLookupInfo, newSQL ="+newSQL); //jz } // Validation @@ -760,8 +758,7 @@ public class MLookupFactory realSQL.append(" ORDER BY 3"); MQuery zoomQuery = null; // corrected in VLookup - if (s_log.isLoggable(Level.FINE)) - s_log.fine("ColumnName=" + ColumnName + " - " + realSQL); + if (s_log.isLoggable(Level.FINE)) s_log.fine("ColumnName=" + ColumnName + " - " + realSQL); StringBuilder msginf = new StringBuilder().append(TableName).append(".").append(KeyColumn); MLookupInfo lInfo = new MLookupInfo(realSQL.toString(), TableName, msginf.toString(), ZoomWindow, ZoomWindowPO, zoomQuery); diff --git a/org.adempiere.base/src/org/compiere/model/MOrderLine.java b/org.adempiere.base/src/org/compiere/model/MOrderLine.java index 8167fefd94..a08322ab67 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderLine.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderLine.java @@ -108,7 +108,7 @@ public class MOrderLine extends X_C_OrderLine if (retValue == null) s_log.fine("-"); else - s_log.fine(retValue.toString()); + if (s_log.isLoggable(Level.FINE)) s_log.fine(retValue.toString()); return retValue; } // getNotReserved diff --git a/org.adempiere.base/src/org/compiere/model/MOrderTax.java b/org.adempiere.base/src/org/compiere/model/MOrderTax.java index 61de671d03..c0cd6a0d88 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderTax.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderTax.java @@ -101,7 +101,7 @@ public class MOrderTax extends X_C_OrderTax { retValue.setPrecision(precision); retValue.set_TrxName(trxName); - s_log.fine("(old=" + oldTax + ") " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine("(old=" + oldTax + ") " + retValue); return retValue; } // If the old tax was required and there is no MOrderTax for that @@ -119,7 +119,7 @@ public class MOrderTax extends X_C_OrderTax retValue.setC_Tax_ID(line.getC_Tax_ID()); retValue.setPrecision(precision); retValue.setIsTaxIncluded(line.isTaxIncluded()); - s_log.fine("(new) " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine("(new) " + retValue); return retValue; } // get diff --git a/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java b/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java index 4d5ac3117a..9386417a2c 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java +++ b/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java @@ -202,7 +202,7 @@ public final class MPaySelectionCheck extends X_C_PaySelectionCheck static public MPaySelectionCheck[] get (int C_PaySelection_ID, String PaymentRule, int startDocumentNo, String trxName) { - s_log.fine("C_PaySelection_ID=" + C_PaySelection_ID + if (s_log.isLoggable(Level.FINE)) s_log.fine("C_PaySelection_ID=" + C_PaySelection_ID + ", PaymentRule=" + PaymentRule + ", startDocumentNo=" + startDocumentNo); ArrayList list = new ArrayList(); @@ -300,11 +300,11 @@ public final class MPaySelectionCheck extends X_C_PaySelectionCheck } // Link to Invoice MPaySelectionLine[] psls = check.getPaySelectionLines(false); - s_log.fine("confirmPrint - " + check + " (#SelectionLines=" + psls.length + ")"); + if (s_log.isLoggable(Level.FINE)) s_log.fine("confirmPrint - " + check + " (#SelectionLines=" + psls.length + ")"); if (check.getQty() == 1 && psls != null && psls.length == 1) { MPaySelectionLine psl = psls[0]; - s_log.fine("Map to Invoice " + psl); + if (s_log.isLoggable(Level.FINE)) s_log.fine("Map to Invoice " + psl); // payment.setC_Invoice_ID (psl.getC_Invoice_ID()); payment.setDiscountAmt (psl.getDiscountAmt()); @@ -352,7 +352,7 @@ public final class MPaySelectionCheck extends X_C_PaySelectionCheck s_log.log(Level.SEVERE, "Check not saved: " + check); } // all checks - s_log.fine("Last Document No = " + lastDocumentNo); + if (s_log.isLoggable(Level.FINE)) s_log.fine("Last Document No = " + lastDocumentNo); return lastDocumentNo; } // confirmPrint diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentValidate.java b/org.adempiere.base/src/org/compiere/model/MPaymentValidate.java index 5e3a6af810..b7572c7b94 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentValidate.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentValidate.java @@ -18,6 +18,7 @@ package org.compiere.model; import java.util.Calendar; import java.util.StringTokenizer; +import java.util.logging.Level; import org.compiere.util.CLogger; @@ -185,7 +186,7 @@ public class MPaymentValidate if (sum % 10 == 0) return ""; - s_log.fine("validateCreditCardNumber - " + creditCardNumber + " -> " + if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardNumber - " + creditCardNumber + " -> " + ccNumber + ", Luhn=" + sum); return "CreditCardNumberError"; } // validateCreditCardNumber @@ -263,7 +264,7 @@ public class MPaymentValidate } if (!ccLengthOK) { - s_log.fine("validateCreditCardNumber Length=" + if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardNumber Length=" + ccLength + " <> " + ccLengthList); return "CreditCardNumberError"; } @@ -279,7 +280,7 @@ public class MPaymentValidate ccIdentified = true; } if (!ccIdentified) - s_log.fine("validateCreditCardNumber Type=" + if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardNumber Type=" + creditCardType + " <> " + ccStartList); // @@ -311,9 +312,9 @@ public class MPaymentValidate } catch (NumberFormatException ex) { - s_log.fine("validateCreditCardVV - " + ex); + if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV - " + ex); } - s_log.fine("validateCreditCardVV - length=" + length); + if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV - length=" + length); return "CreditCardVVError"; } // validateCreditCardVV @@ -344,10 +345,10 @@ public class MPaymentValidate } catch (NumberFormatException ex) { - s_log.fine("validateCreditCardVV - " + ex); + if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV - " + ex); } } - s_log.fine("validateCreditCardVV(4) CC=" + creditCardType + ", length=" + length); + if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV(4) CC=" + creditCardType + ", length=" + length); return "CreditCardVVError"; } // Visa & MasterCard - 3 digits @@ -363,10 +364,10 @@ public class MPaymentValidate } catch (NumberFormatException ex) { - s_log.fine("validateCreditCardVV - " + ex); + if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV - " + ex); } } - s_log.fine("validateCreditCardVV(3) CC=" + creditCardType + ", length=" + length); + if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV(3) CC=" + creditCardType + ", length=" + length); return "CreditCardVVError"; } diff --git a/org.adempiere.base/src/org/compiere/model/MProductCategory.java b/org.adempiere.base/src/org/compiere/model/MProductCategory.java index 2a817bb1d8..d191bf9820 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MProductCategory.java @@ -101,7 +101,7 @@ public class MProductCategory extends X_M_Product_Category // TODO: LRU logic s_products.put(product, category); // - s_log.fine("M_Product_ID=" + M_Product_ID + "(" + category + if (s_log.isLoggable(Level.FINE)) s_log.fine("M_Product_ID=" + M_Product_ID + "(" + category + ") in M_Product_Category_ID=" + M_Product_Category_ID + " - " + (category.intValue() == M_Product_Category_ID)); return category.intValue() == M_Product_Category_ID; diff --git a/org.adempiere.base/src/org/compiere/model/MQuery.java b/org.adempiere.base/src/org/compiere/model/MQuery.java index 5803cc681d..330c37e1d3 100644 --- a/org.adempiere.base/src/org/compiere/model/MQuery.java +++ b/org.adempiere.base/src/org/compiere/model/MQuery.java @@ -139,7 +139,7 @@ public class MQuery implements Serializable String Name = rs.getString(10); boolean isRange = "Y".equals(rs.getString(11)); // - s_log.fine(ParameterName + " S=" + P_String + "-" + P_String_To + if (s_log.isLoggable(Level.FINE)) s_log.fine(ParameterName + " S=" + P_String + "-" + P_String_To + ", N=" + P_Number + "-" + P_Number_To + ", D=" + P_Date + "-" + P_Date_To + "; Name=" + Name + ", Info=" + Info + "-" + Info_To + ", Range=" + isRange); // diff --git a/org.adempiere.base/src/org/compiere/model/MRMATax.java b/org.adempiere.base/src/org/compiere/model/MRMATax.java index 9f59b2aa3f..fd7e4256fa 100644 --- a/org.adempiere.base/src/org/compiere/model/MRMATax.java +++ b/org.adempiere.base/src/org/compiere/model/MRMATax.java @@ -96,7 +96,7 @@ public class MRMATax extends X_M_RMATax { retValue.setPrecision(precision); retValue.set_TrxName(trxName); - s_log.fine("(old=" + oldTax + ") " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine("(old=" + oldTax + ") " + retValue); return retValue; } // If the old tax was required and there is no MOrderTax for that @@ -114,7 +114,7 @@ public class MRMATax extends X_M_RMATax retValue.setC_Tax_ID(line.getC_Tax_ID()); retValue.setPrecision(precision); retValue.setIsTaxIncluded(line.getParent().isTaxIncluded()); - s_log.fine("(new) " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine("(new) " + retValue); return retValue; } diff --git a/org.adempiere.base/src/org/compiere/model/MRegion.java b/org.adempiere.base/src/org/compiere/model/MRegion.java index 23b739f8ea..9b55283fff 100644 --- a/org.adempiere.base/src/org/compiere/model/MRegion.java +++ b/org.adempiere.base/src/org/compiere/model/MRegion.java @@ -81,7 +81,7 @@ public final class MRegion extends X_C_Region rs = null; stmt = null; } - s_log.fine(s_regions.size() + " - default=" + s_default); + if (s_log.isLoggable(Level.FINE)) s_log.fine(s_regions.size() + " - default=" + s_default); } // loadAllRegions /** diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index a282c56e15..cc7055eeb0 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -449,7 +449,7 @@ public class MSequence extends X_AD_Sequence // + " - Type=" + pstmt.getResultSetType() + " - Concur=" + pstmt.getResultSetConcurrency()); if (rs.next()) { - s_log.fine("AD_Sequence_ID="+AD_Sequence_ID); + if (s_log.isLoggable(Level.FINE)) s_log.fine("AD_Sequence_ID="+AD_Sequence_ID); PreparedStatement updateSQL = null; try @@ -656,7 +656,7 @@ public class MSequence extends X_AD_Sequence while (rs.next()) { String tableName = rs.getString(1); - s_log.fine("Add: " + tableName); + if (s_log.isLoggable(Level.FINE)) s_log.fine("Add: " + tableName); MSequence seq = new MSequence (ctx, AD_Client_ID, tableName, trxName); if (seq.save()) counter++; diff --git a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java index 5e7eacf69a..1222509f5b 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageOnHand.java @@ -67,10 +67,10 @@ public class MStorageOnHand extends X_M_StorageOnHand .first(); if (retValue == null) - s_log.fine("Not Found - M_Locator_ID=" + M_Locator_ID + if (s_log.isLoggable(Level.FINE)) s_log.fine("Not Found - M_Locator_ID=" + M_Locator_ID + ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID); else - s_log.fine("M_Locator_ID=" + M_Locator_ID + if (s_log.isLoggable(Level.FINE)) s_log.fine("M_Locator_ID=" + M_Locator_ID + ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID); return retValue; } // get @@ -339,7 +339,7 @@ public class MStorageOnHand extends X_M_StorageOnHand // retValue = new MStorageOnHand (locator, M_Product_ID, M_AttributeSetInstance_ID); retValue.saveEx(trxName); - s_log.fine("New " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine("New " + retValue); return retValue; } // getCreate @@ -380,7 +380,7 @@ public class MStorageOnHand extends X_M_StorageOnHand storage.setQtyOnHand (storage.getQtyOnHand().add (diffQtyOnHand)); if (s_log.isLoggable(Level.FINE)) { StringBuilder diffText = new StringBuilder("(OnHand=").append(diffQtyOnHand).append(") -> ").append(storage.toString()); - s_log.fine(diffText.toString()); + if (s_log.isLoggable(Level.FINE)) s_log.fine(diffText.toString()); } return storage.save (trxName); } // add diff --git a/org.adempiere.base/src/org/compiere/model/MStorageReservation.java b/org.adempiere.base/src/org/compiere/model/MStorageReservation.java index 318800303f..943c31f9f8 100644 --- a/org.adempiere.base/src/org/compiere/model/MStorageReservation.java +++ b/org.adempiere.base/src/org/compiere/model/MStorageReservation.java @@ -75,10 +75,10 @@ public class MStorageReservation extends X_M_StorageReservation { rs = null; pstmt = null; } if (retValue == null) - s_log.fine("Not Found - M_Warehouse_ID=" + M_Warehouse_ID + if (s_log.isLoggable(Level.FINE)) s_log.fine("Not Found - M_Warehouse_ID=" + M_Warehouse_ID + ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID + ", IsSOTrx=" + isSOTrx); else - s_log.fine("M_Warehouse_ID=" + M_Warehouse_ID + if (s_log.isLoggable(Level.FINE)) s_log.fine("M_Warehouse_ID=" + M_Warehouse_ID + ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID + ", IsSOTrx=" + isSOTrx); return retValue; } // get @@ -257,7 +257,7 @@ public class MStorageReservation extends X_M_StorageReservation { storage.setQty (storage.getQty().add(diffQty)); if (s_log.isLoggable(Level.FINE)) { StringBuilder diffText = new StringBuilder("(Qty=").append(diffQty).append(") -> ").append(storage.toString()); - s_log.fine(diffText.toString()); + if (s_log.isLoggable(Level.FINE)) s_log.fine(diffText.toString()); } return storage.save (trxName); } // add @@ -289,7 +289,7 @@ public class MStorageReservation extends X_M_StorageReservation { // retValue = new MStorageReservation (warehouse, M_Product_ID, M_AttributeSetInstance_ID, isSOTrx); retValue.saveEx(trxName); - s_log.fine("New " + retValue); + if (s_log.isLoggable(Level.FINE)) s_log.fine("New " + retValue); return retValue; } // getCreate diff --git a/org.adempiere.base/src/org/compiere/model/MUOMConversion.java b/org.adempiere.base/src/org/compiere/model/MUOMConversion.java index 0daa34a608..6fe17508c5 100644 --- a/org.adempiere.base/src/org/compiere/model/MUOMConversion.java +++ b/org.adempiere.base/src/org/compiere/model/MUOMConversion.java @@ -533,7 +533,7 @@ public class MUOMConversion extends X_C_UOM_Conversion if (qtyPrice == null || qtyPrice.compareTo(Env.ZERO)==0 || C_UOM_To_ID == 0|| M_Product_ID == 0) { - s_log.fine("No Conversion - QtyPrice=" + qtyPrice); + if (s_log.isLoggable(Level.FINE)) s_log.fine("No Conversion - QtyPrice=" + qtyPrice); return qtyPrice; } @@ -547,7 +547,7 @@ public class MUOMConversion extends X_C_UOM_Conversion return uom.round(retValue.multiply(qtyPrice), true); return retValue.multiply(qtyPrice); } - s_log.fine("No Rate M_Product_ID=" + M_Product_ID); + if (s_log.isLoggable(Level.FINE)) s_log.fine("No Rate M_Product_ID=" + M_Product_ID); return null; } // convertProductFrom @@ -613,7 +613,7 @@ public class MUOMConversion extends X_C_UOM_Conversion result = new MUOMConversion[list.size ()]; list.toArray (result); s_conversionProduct.put(key, result); - s_log.fine("getProductConversions - M_Product_ID=" + M_Product_ID + " #" + result.length); + if (s_log.isLoggable(Level.FINE)) s_log.fine("getProductConversions - M_Product_ID=" + M_Product_ID + " #" + result.length); return result; } // getProductConversions diff --git a/org.adempiere.base/src/org/compiere/model/MWarehousePrice.java b/org.adempiere.base/src/org/compiere/model/MWarehousePrice.java index 30b784a732..9dcdda3dba 100644 --- a/org.adempiere.base/src/org/compiere/model/MWarehousePrice.java +++ b/org.adempiere.base/src/org/compiere/model/MWarehousePrice.java @@ -90,7 +90,7 @@ public class MWarehousePrice extends X_RV_WarehousePrice // String finalSQL = MRole.getDefault().addAccessSQL(sql.toString(), "RV_WarehousePrice", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); - s_log.fine("find - M_PriceList_Version_ID=" + M_PriceList_Version_ID + if (s_log.isLoggable(Level.FINE)) s_log.fine("find - M_PriceList_Version_ID=" + M_PriceList_Version_ID + ", M_Warehouse_ID=" + M_Warehouse_ID + " - " + finalSQL); ArrayList list = new ArrayList(); @@ -125,7 +125,7 @@ public class MWarehousePrice extends X_RV_WarehousePrice pstmt = null; } // - s_log.fine("find - #" + list.size()); + if (s_log.isLoggable(Level.FINE)) s_log.fine("find - #" + list.size()); MWarehousePrice[] retValue = new MWarehousePrice[list.size()]; list.toArray(retValue); return retValue; diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index 5feaf4f60e..37b47fb8f4 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -1238,7 +1238,7 @@ public abstract class PO */ public static void copyValues (PO from, PO to) { - s_log.fine("From ID=" + from.get_ID() + " - To ID=" + to.get_ID()); + if (s_log.isLoggable(Level.FINE)) s_log.fine("From ID=" + from.get_ID() + " - To ID=" + to.get_ID()); // Different Classes if (from.getClass() != to.getClass()) { From 427e8e08f2c9daeb0f5840c45875519dd346f22b Mon Sep 17 00:00:00 2001 From: Richard Morales Date: Fri, 22 Feb 2013 15:59:05 -0500 Subject: [PATCH 7/8] IDEMPIERE-638 Check log level before calling logging method / s_log.info logger.config+info --- .../compiere/process/DocumentTypeVerify.java | 8 ++++---- .../src/org/compiere/process/SequenceCheck.java | 2 +- .../org/adempiere/model/ZoomInfoFactory.java | 3 ++- .../src/org/compiere/model/MChangeLog.java | 2 +- .../src/org/compiere/model/MConversionRate.java | 2 +- .../src/org/compiere/model/MCost.java | 2 +- .../src/org/compiere/model/MCostElement.java | 3 ++- .../src/org/compiere/model/MInOutConfirm.java | 4 ++-- .../src/org/compiere/model/MMatchPO.java | 2 +- .../src/org/compiere/model/MPeriod.java | 2 +- .../org/compiere/model/MProductDownload.java | 2 +- .../src/org/compiere/model/MQuery.java | 6 +++--- .../src/org/compiere/model/MRefList.java | 2 +- .../src/org/compiere/model/MRole.java | 10 +++++----- .../src/org/compiere/model/MRoleOrgAccess.java | 2 +- .../src/org/compiere/model/MSequence.java | 2 +- .../src/org/compiere/model/MStatusCategory.java | 2 +- .../src/org/compiere/model/MStore.java | 2 +- .../compiere/model/MToolBarButtonRestrict.java | 9 +++------ .../src/org/compiere/model/MUOMConversion.java | 2 +- .../src/org/compiere/print/MPrintFormat.java | 10 +++++----- .../src/org/compiere/util/Msg.java | 5 ++--- .../org/idempiere/fa/process/SvrProcess2.java | 3 ++- .../adempiere/process/rpl/imp/ImportHelper.java | 5 +++-- .../src/org/compiere/apps/AZoomAcross.java | 3 ++- .../adempiere/webui/adwindow/ADTabpanel.java | 17 +++++------------ .../webui/adwindow/AbstractADWindowContent.java | 2 +- .../org/adempiere/webui/component/WListbox.java | 4 ++-- .../adempiere/webui/panel/WDocActionPanel.java | 3 ++- .../adempiere/webui/util/GridTabDataBinder.java | 9 +++++---- .../src/org/compiere/print/ReportCtl.java | 2 +- 31 files changed, 64 insertions(+), 68 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/DocumentTypeVerify.java b/org.adempiere.base.process/src/org/compiere/process/DocumentTypeVerify.java index 370e7a8ad8..06967747b5 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DocumentTypeVerify.java +++ b/org.adempiere.base.process/src/org/compiere/process/DocumentTypeVerify.java @@ -71,7 +71,7 @@ public class DocumentTypeVerify extends SvrProcess public static void createDocumentTypes(Properties ctx, int AD_Client_ID, SvrProcess sp, String trxName) { - s_log.info("AD_Client_ID=" + AD_Client_ID); + if (s_log.isLoggable(Level.INFO)) s_log.info("AD_Client_ID=" + AD_Client_ID); String sql = "SELECT rl.Value, rl.Name " + "FROM AD_Ref_List rl " + "WHERE rl.AD_Reference_ID=183" @@ -129,7 +129,7 @@ public class DocumentTypeVerify extends SvrProcess public static void createPeriodControls(Properties ctx, int AD_Client_ID, SvrProcess sp, String trxName) { - s_log.info("AD_Client_ID=" + AD_Client_ID); + if (s_log.isLoggable(Level.INFO)) s_log.info("AD_Client_ID=" + AD_Client_ID); // Delete Duplicates String sql = "DELETE C_PeriodControl pc1 " @@ -143,7 +143,7 @@ public class DocumentTypeVerify extends SvrProcess + "FROM C_PeriodControl pc3 " + "GROUP BY C_Period_ID, DocBaseType)"; int no = DB.executeUpdate(sql, false, trxName); - s_log.info("Duplicates deleted #" + no); + if (s_log.isLoggable(Level.INFO)) s_log.info("Duplicates deleted #" + no); // Insert Missing sql = "SELECT DISTINCT p.AD_Client_ID, p.C_Period_ID, dt.DocBaseType " @@ -192,7 +192,7 @@ public class DocumentTypeVerify extends SvrProcess } if (sp != null) sp.addLog (0, null, new BigDecimal(counter), "@C_PeriodControl_ID@ @Created@"); - s_log.info("Inserted #" + counter); + if (s_log.isLoggable(Level.INFO)) s_log.info("Inserted #" + counter); } // createPeriodControls } // DocumentTypeVerify diff --git a/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java b/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java index 278df7c77c..ac1147c047 100644 --- a/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java +++ b/org.adempiere.base.process/src/org/compiere/process/SequenceCheck.java @@ -194,7 +194,7 @@ public class SequenceCheck extends SvrProcess if (IDRangeEnd <= 0) IDRangeEnd = DB.getSQLValue(null, "SELECT MIN(IDRangeStart)-1 FROM AD_Replication"); - s_log.info("IDRangeEnd = " + IDRangeEnd); + if (s_log.isLoggable(Level.INFO)) s_log.info("IDRangeEnd = " + IDRangeEnd); // String sql = "SELECT * FROM AD_Sequence " + "WHERE IsTableID='Y' " diff --git a/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java b/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java index 07b76a9b12..2223331544 100644 --- a/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java +++ b/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java @@ -17,6 +17,7 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.logging.Level; import org.compiere.model.MQuery; import org.compiere.model.PO; @@ -83,7 +84,7 @@ public class ZoomInfoFactory { public static List retrieveZoomInfos(final PO po, final int windowID) { - logger.config("PO=" + po + " - AD_Window_ID=" + windowID); + if (logger.isLoggable(Level.CONFIG)) logger.config("PO=" + po + " - AD_Window_ID=" + windowID); final List result = new ArrayList(); diff --git a/org.adempiere.base/src/org/compiere/model/MChangeLog.java b/org.adempiere.base/src/org/compiere/model/MChangeLog.java index 4dfe13426d..a282041244 100644 --- a/org.adempiere.base/src/org/compiere/model/MChangeLog.java +++ b/org.adempiere.base/src/org/compiere/model/MChangeLog.java @@ -90,7 +90,7 @@ public class MChangeLog extends X_AD_ChangeLog Integer id = (Integer)list.get(i); s_changeLog[i] = id.intValue(); } - s_log.info("#" + s_changeLog.length); + if (s_log.isLoggable(Level.INFO)) s_log.info("#" + s_changeLog.length); } // fillChangeLog /** Change Log */ diff --git a/org.adempiere.base/src/org/compiere/model/MConversionRate.java b/org.adempiere.base/src/org/compiere/model/MConversionRate.java index 49db829f30..6b4d0d1120 100644 --- a/org.adempiere.base/src/org/compiere/model/MConversionRate.java +++ b/org.adempiere.base/src/org/compiere/model/MConversionRate.java @@ -251,7 +251,7 @@ public class MConversionRate extends X_C_Conversion_Rate pstmt = null; } if (retValue == null) - s_log.info ("getRate - not found - CurFrom=" + CurFrom_ID + if (s_log.isLoggable(Level.INFO)) s_log.info ("getRate - not found - CurFrom=" + CurFrom_ID + ", CurTo=" + CurTo_ID + ", " + ConvDate + ", Type=" + ConversionType_ID + (ConversionType_ID==C_ConversionType_ID ? "" : "->" + C_ConversionType_ID) diff --git a/org.adempiere.base/src/org/compiere/model/MCost.java b/org.adempiere.base/src/org/compiere/model/MCost.java index d966136a51..1fb29b4be6 100644 --- a/org.adempiere.base/src/org/compiere/model/MCost.java +++ b/org.adempiere.base/src/org/compiere/model/MCost.java @@ -659,7 +659,7 @@ public class MCost extends X_M_Cost { BigDecimal cost = getCurrentCost(product, 0, ass[i], 0, null, Env.ONE, 0, false, trxNameUsed); // create non-zero costs - s_log.info(product.getName() + " = " + cost); + if (s_log.isLoggable(Level.INFO)) s_log.info(product.getName() + " = " + cost); } } } diff --git a/org.adempiere.base/src/org/compiere/model/MCostElement.java b/org.adempiere.base/src/org/compiere/model/MCostElement.java index 9b319fb855..08f165bb3b 100644 --- a/org.adempiere.base/src/org/compiere/model/MCostElement.java +++ b/org.adempiere.base/src/org/compiere/model/MCostElement.java @@ -19,6 +19,7 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import org.compiere.util.CCache; import org.compiere.util.CLogger; @@ -100,7 +101,7 @@ public class MCostElement extends X_M_CostElement if (list.size() > 0) retValue = list.get(0); if (list.size() > 1) - s_log.info("More then one Material Cost Element for CostingMethod=" + CostingMethod); + if (s_log.isLoggable(Level.INFO)) s_log.info("More then one Material Cost Element for CostingMethod=" + CostingMethod); return retValue; } // getMaterialCostElement diff --git a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java index 4ec4f65472..1f261da4b0 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java @@ -70,7 +70,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction MInOutConfirm confirm = confirmations[i]; if (confirm.getConfirmType().equals(confirmType)) { - s_log.info("create - existing: " + confirm); + if (s_log.isLoggable(Level.INFO)) s_log.info("create - existing: " + confirm); return confirm; } } @@ -86,7 +86,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction cLine.setInOutLine(sLine); cLine.saveEx(); } - s_log.info("New: " + confirm); + if (s_log.isLoggable(Level.INFO)) s_log.info("New: " + confirm); return confirm; } // MInOutConfirm diff --git a/org.adempiere.base/src/org/compiere/model/MMatchPO.java b/org.adempiere.base/src/org/compiere/model/MMatchPO.java index 98e3229b1b..84728fb44a 100644 --- a/org.adempiere.base/src/org/compiere/model/MMatchPO.java +++ b/org.adempiere.base/src/org/compiere/model/MMatchPO.java @@ -1111,7 +1111,7 @@ public class MMatchPO extends X_M_MatchPO if (errors == 0 && success == 0) ; else - s_log.info("Success #" + success + " - Error #" + errors); + if (s_log.isLoggable(Level.INFO)) s_log.info("Success #" + success + " - Error #" + errors); } // consolidate //AZ Goodwill diff --git a/org.adempiere.base/src/org/compiere/model/MPeriod.java b/org.adempiere.base/src/org/compiere/model/MPeriod.java index 0fdcf80a44..b884f2de1f 100644 --- a/org.adempiere.base/src/org/compiere/model/MPeriod.java +++ b/org.adempiere.base/src/org/compiere/model/MPeriod.java @@ -179,7 +179,7 @@ public class MPeriod extends X_C_Period rs = null; pstmt = null; } if (retValue == null) - s_log.info("No Standard Period for " + DateAcct + if (s_log.isLoggable(Level.INFO)) s_log.info("No Standard Period for " + DateAcct + " (AD_Client_ID=" + AD_Client_ID + ")"); return retValue; } diff --git a/org.adempiere.base/src/org/compiere/model/MProductDownload.java b/org.adempiere.base/src/org/compiere/model/MProductDownload.java index e983330097..c8e3756152 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductDownload.java +++ b/org.adempiere.base/src/org/compiere/model/MProductDownload.java @@ -98,7 +98,7 @@ public class MProductDownload extends X_M_ProductDownload rs = null; pstmt = null; } - s_log.info("#" + count); + if (s_log.isLoggable(Level.INFO)) s_log.info("#" + count); } // migrateDownloads /** Logger */ diff --git a/org.adempiere.base/src/org/compiere/model/MQuery.java b/org.adempiere.base/src/org/compiere/model/MQuery.java index 330c37e1d3..8cc2c62032 100644 --- a/org.adempiere.base/src/org/compiere/model/MQuery.java +++ b/org.adempiere.base/src/org/compiere/model/MQuery.java @@ -54,7 +54,7 @@ public class MQuery implements Serializable */ static public MQuery get (Properties ctx, int AD_PInstance_ID, String TableName) { - s_log.info("AD_PInstance_ID=" + AD_PInstance_ID + ", TableName=" + TableName); + if (s_log.isLoggable(Level.INFO)) s_log.info("AD_PInstance_ID=" + AD_PInstance_ID + ", TableName=" + TableName); MQuery query = new MQuery(TableName); // Temporary Tables - add qualifier (not displayed) boolean isTemporaryTable = false; @@ -147,7 +147,7 @@ public class MQuery implements Serializable // This condition applies only to temporary tables - teo_sarca [ 2860022 ] if (isTemporaryTable && !isFinancialReport && table != null && table.getColumn(ParameterName) == null) { - s_log.info("Skip parameter "+ParameterName+" because there is no column in table "+TableName); + if (s_log.isLoggable(Level.INFO)) s_log.info("Skip parameter "+ParameterName+" because there is no column in table "+TableName); continue; } @@ -222,7 +222,7 @@ public class MQuery implements Serializable DB.close(rs, pstmt); rs = null; pstmt = null; } - s_log.info(query.toString()); + if (s_log.isLoggable(Level.INFO)) s_log.info(query.toString()); return query; } // get diff --git a/org.adempiere.base/src/org/compiere/model/MRefList.java b/org.adempiere.base/src/org/compiere/model/MRefList.java index b5227056dd..f3d5916086 100644 --- a/org.adempiere.base/src/org/compiere/model/MRefList.java +++ b/org.adempiere.base/src/org/compiere/model/MRefList.java @@ -170,7 +170,7 @@ public class MRefList extends X_AD_Ref_List if (retValue == null) { retValue = ""; - s_log.info("getListDescription - Not found " + key); + if (s_log.isLoggable(Level.INFO)) s_log.info("getListDescription - Not found " + key); } s_cache.put(key, retValue); // diff --git a/org.adempiere.base/src/org/compiere/model/MRole.java b/org.adempiere.base/src/org/compiere/model/MRole.java index 037e5c0f20..9846a42198 100644 --- a/org.adempiere.base/src/org/compiere/model/MRole.java +++ b/org.adempiere.base/src/org/compiere/model/MRole.java @@ -119,7 +119,7 @@ public final class MRole extends X_AD_Role */ public static MRole get (Properties ctx, int AD_Role_ID, int AD_User_ID, boolean reload) { - s_log.info("AD_Role_ID=" + AD_Role_ID + ", AD_User_ID=" + AD_User_ID + ", reload=" + reload); + if (s_log.isLoggable(Level.INFO)) s_log.info("AD_Role_ID=" + AD_Role_ID + ", AD_User_ID=" + AD_User_ID + ", reload=" + reload); String key = AD_Role_ID + "_" + AD_User_ID; MRole role = (MRole)s_roles.get (key); if (role == null || reload) @@ -133,7 +133,7 @@ public final class MRole extends X_AD_Role } role.setAD_User_ID(AD_User_ID); role.loadAccess(reload); - s_log.info(role.toString()); + if (s_log.isLoggable(Level.INFO)) s_log.info(role.toString()); } return role; } // get @@ -2538,7 +2538,7 @@ public final class MRole extends X_AD_Role pstmt1.setInt(1, getAD_Role_ID()); pstmt1.setString(2, doc.getDocBaseType()); - s_log.info(sql1 + " : " + getAD_Role_ID() + " " + if (s_log.isLoggable(Level.INFO)) s_log.info(sql1 + " : " + getAD_Role_ID() + " " + doc.getDocBaseType()); rs1 = pstmt1.executeQuery(); @@ -2563,7 +2563,7 @@ public final class MRole extends X_AD_Role pstmt = DB.prepareStatement(sql, null); DB.setParameters(pstmt, params); - s_log.info(sql + " : " ); + if (s_log.isLoggable(Level.INFO)) s_log.info(sql + " : " ); rs = pstmt.executeQuery(); while (rs.next()) { String op = rs.getString(1); @@ -2619,7 +2619,7 @@ public final class MRole extends X_AD_Role } } - s_log.info("Include "+role); + if (s_log.isLoggable(Level.INFO)) s_log.info("Include "+role); if(role.isActive()){ this.m_includedRoles.add(role); diff --git a/org.adempiere.base/src/org/compiere/model/MRoleOrgAccess.java b/org.adempiere.base/src/org/compiere/model/MRoleOrgAccess.java index 9686cb1e81..92fd9cde5c 100644 --- a/org.adempiere.base/src/org/compiere/model/MRoleOrgAccess.java +++ b/org.adempiere.base/src/org/compiere/model/MRoleOrgAccess.java @@ -126,7 +126,7 @@ public class MRoleOrgAccess extends X_AD_Role_OrgAccess counter++; } } - s_log.info(org + " - created #" + counter); + if (s_log.isLoggable(Level.INFO)) s_log.info(org + " - created #" + counter); return counter != 0; } // createForOrg diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index cc7055eeb0..631314e1e1 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -678,7 +678,7 @@ public class MSequence extends X_AD_Sequence rs = null; pstmt = null; } - s_log.info ("AD_Client_ID=" + AD_Client_ID + if (s_log.isLoggable(Level.INFO)) s_log.info ("AD_Client_ID=" + AD_Client_ID + " - created #" + counter + " - success=" + success); return success; diff --git a/org.adempiere.base/src/org/compiere/model/MStatusCategory.java b/org.adempiere.base/src/org/compiere/model/MStatusCategory.java index a196e7fc38..3ec805e663 100644 --- a/org.adempiere.base/src/org/compiere/model/MStatusCategory.java +++ b/org.adempiere.base/src/org/compiere/model/MStatusCategory.java @@ -94,7 +94,7 @@ public class MStatusCategory extends X_R_StatusCategory String sql = "UPDATE R_Status SET R_StatusCategory_ID=" + retValue.getR_StatusCategory_ID() + " WHERE R_StatusCategory_ID IS NULL AND AD_Client_ID=" + AD_Client_ID; int no = DB.executeUpdate(sql, null); - s_log.info("Default for AD_Client_ID=" + AD_Client_ID + " - Status #" + no); + if (s_log.isLoggable(Level.INFO)) s_log.info("Default for AD_Client_ID=" + AD_Client_ID + " - Status #" + no); return retValue; } // createDefault diff --git a/org.adempiere.base/src/org/compiere/model/MStore.java b/org.adempiere.base/src/org/compiere/model/MStore.java index af83283297..a7898f3314 100644 --- a/org.adempiere.base/src/org/compiere/model/MStore.java +++ b/org.adempiere.base/src/org/compiere/model/MStore.java @@ -185,7 +185,7 @@ public class MStore extends X_W_Store Collection cc = s_cache.values(); Object[] oo = cc.toArray(); for (int i = 0; i < oo.length; i++) - s_log.info(i + ": " + oo[i]); + if (s_log.isLoggable(Level.INFO)) s_log.info(i + ": " + oo[i]); MStore[] retValue = new MStore[oo.length]; for (int i = 0; i < oo.length; i++) retValue[i] = (MStore)oo[i]; diff --git a/org.adempiere.base/src/org/compiere/model/MToolBarButtonRestrict.java b/org.adempiere.base/src/org/compiere/model/MToolBarButtonRestrict.java index 484541ea4c..9f67873706 100644 --- a/org.adempiere.base/src/org/compiere/model/MToolBarButtonRestrict.java +++ b/org.adempiere.base/src/org/compiere/model/MToolBarButtonRestrict.java @@ -92,8 +92,7 @@ public class MToolBarButtonRestrict extends X_AD_ToolBarButtonRestrict **/ public static int[] getOfWindow(Properties ctx, int AD_Role_ID, int AD_Window_ID, boolean reportViewer, String trxName) { - if (s_log.isLoggable(Level.INFO)) - s_log.info("sql="+GET_OF_WINDOW_SQL); + if (s_log.isLoggable(Level.INFO)) s_log.info("sql="+GET_OF_WINDOW_SQL); int[] ids = DB.getIDsEx(trxName, GET_OF_WINDOW_SQL, Env.getAD_Client_ID(ctx), AD_Role_ID, AD_Window_ID, reportViewer ? "R" : "W"); @@ -109,8 +108,7 @@ public class MToolBarButtonRestrict extends X_AD_ToolBarButtonRestrict **/ public static int[] getOfReport(Properties ctx, int AD_Role_ID, int AD_Process_ID, String trxName) { - if (s_log.isLoggable(Level.INFO)) - s_log.info("sql="+GET_OF_REPORT_SQL); + if (s_log.isLoggable(Level.INFO)) s_log.info("sql="+GET_OF_REPORT_SQL); int[] ids = DB.getIDsEx(trxName, GET_OF_REPORT_SQL, Env.getAD_Client_ID(ctx), AD_Role_ID, AD_Process_ID, "R"); @@ -120,8 +118,7 @@ public class MToolBarButtonRestrict extends X_AD_ToolBarButtonRestrict /** Returns a list of restrictions to be applied according to the role for ad_tab toolbar buttons **/ public static int[] getOfTab(Properties ctx, int AD_Role_ID, int AD_Tab_ID, String trxName) { - if (s_log.isLoggable(Level.INFO)) - s_log.info("sql="+GET_OF_TAB_SQL); + if (s_log.isLoggable(Level.INFO)) s_log.info("sql="+GET_OF_TAB_SQL); int[] ids = DB.getIDsEx(trxName, GET_OF_TAB_SQL, Env.getAD_Client_ID(ctx), AD_Role_ID, AD_Tab_ID); diff --git a/org.adempiere.base/src/org/compiere/model/MUOMConversion.java b/org.adempiere.base/src/org/compiere/model/MUOMConversion.java index 6fe17508c5..7dfc99b2c4 100644 --- a/org.adempiere.base/src/org/compiere/model/MUOMConversion.java +++ b/org.adempiere.base/src/org/compiere/model/MUOMConversion.java @@ -434,7 +434,7 @@ public class MUOMConversion extends X_C_UOM_Conversion } if (retValue == null) { - s_log.info ("NOT found - FromUOM=" + C_UOM_From_ID + ", ToUOM=" + C_UOM_To_ID); + if (s_log.isLoggable(Level.INFO)) s_log.info ("NOT found - FromUOM=" + C_UOM_From_ID + ", ToUOM=" + C_UOM_To_ID); return null; } diff --git a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java index b13f432d3a..0b3fe5f4a0 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java @@ -656,7 +656,7 @@ public class MPrintFormat extends X_AD_PrintFormat int AD_Table_ID, int AD_PrintFormat_ID) { int AD_Client_ID = Env.getAD_Client_ID(ctx); - s_log.info ("AD_Table_ID=" + AD_Table_ID + " - AD_Client_ID=" + AD_Client_ID); + if (s_log.isLoggable(Level.INFO)) s_log.info ("AD_Table_ID=" + AD_Table_ID + " - AD_Client_ID=" + AD_Client_ID); MPrintFormat pf = new MPrintFormat(ctx, AD_PrintFormat_ID, null); pf.setAD_Table_ID (AD_Table_ID); @@ -739,7 +739,7 @@ public class MPrintFormat extends X_AD_PrintFormat static public MPrintFormat createFromReportView (Properties ctx, int AD_ReportView_ID, String ReportName) { int AD_Client_ID = Env.getAD_Client_ID(ctx); - s_log.info ("AD_ReportView_ID=" + AD_ReportView_ID + " - AD_Client_ID=" + AD_Client_ID + " - " + ReportName); + if (s_log.isLoggable(Level.INFO)) s_log.info ("AD_ReportView_ID=" + AD_ReportView_ID + " - AD_Client_ID=" + AD_Client_ID + " - " + ReportName); MPrintFormat pf = new MPrintFormat(ctx, 0, null); pf.setAD_ReportView_ID (AD_ReportView_ID); @@ -895,7 +895,7 @@ public class MPrintFormat extends X_AD_PrintFormat // MPrintFormatItem[] retValue = new MPrintFormatItem[list.size()]; list.toArray(retValue); - s_log.info(format + " - #" + retValue.length); + if (s_log.isLoggable(Level.INFO)) s_log.info(format + " - #" + retValue.length); return retValue; } // createItems @@ -907,7 +907,7 @@ public class MPrintFormat extends X_AD_PrintFormat */ static private MPrintFormatItem[] copyItems (MPrintFormat fromFormat, MPrintFormat toFormat) { - s_log.info("From=" + fromFormat); + if (s_log.isLoggable(Level.INFO)) s_log.info("From=" + fromFormat); ArrayList list = new ArrayList(); MPrintFormatItem[] items = fromFormat.getItemsNotIn(toFormat.get_ID()); @@ -1003,7 +1003,7 @@ public class MPrintFormat extends X_AD_PrintFormat private static MPrintFormat copy (Properties ctx, int from_AD_PrintFormat_ID, int to_AD_PrintFormat_ID, int to_Client_ID) { - s_log.info ("From AD_PrintFormat_ID=" + from_AD_PrintFormat_ID + if (s_log.isLoggable(Level.INFO)) s_log.info ("From AD_PrintFormat_ID=" + from_AD_PrintFormat_ID + ", To AD_PrintFormat_ID=" + to_AD_PrintFormat_ID + ", To Client_ID=" + to_Client_ID); if (from_AD_PrintFormat_ID == 0) diff --git a/org.adempiere.base/src/org/compiere/util/Msg.java b/org.adempiere.base/src/org/compiere/util/Msg.java index 8a1e29605d..17fb61c572 100644 --- a/org.adempiere.base/src/org/compiere/util/Msg.java +++ b/org.adempiere.base/src/org/compiere/util/Msg.java @@ -158,7 +158,7 @@ public final class Msg s_log.log(Level.SEVERE, "Too few (" + msg.size() + ") Records found for " + AD_Language); return null; } - s_log.info("Records=" + msg.size() + " - " + AD_Language); + if (s_log.isLoggable(Level.INFO)) s_log.info("Records=" + msg.size() + " - " + AD_Language); return msg; } // initMsg @@ -259,8 +259,7 @@ public final class Msg // if (retStr == null || retStr.length() == 0) { - if (s_log.isLoggable(Level.INFO)) - s_log.info("NOT found: " + AD_Message); + if (s_log.isLoggable(Level.INFO)) s_log.info("NOT found: " + AD_Message); return AD_Message; } diff --git a/org.adempiere.base/src/org/idempiere/fa/process/SvrProcess2.java b/org.adempiere.base/src/org/idempiere/fa/process/SvrProcess2.java index 87d0488f81..70f3d51edb 100644 --- a/org.adempiere.base/src/org/idempiere/fa/process/SvrProcess2.java +++ b/org.adempiere.base/src/org/idempiere/fa/process/SvrProcess2.java @@ -4,6 +4,7 @@ package org.idempiere.fa.process; import java.lang.reflect.Field; +import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; import org.compiere.process.ProcessInfoParameter; @@ -85,7 +86,7 @@ public abstract class SvrProcess2 extends SvrProcess // if (!isSet) { - s_log.info("Parameter not set - "+parameterName); + if (s_log.isLoggable(Level.INFO)) s_log.info("Parameter not set - "+parameterName); } } // for Field } diff --git a/org.adempiere.replication/src/org/adempiere/process/rpl/imp/ImportHelper.java b/org.adempiere.replication/src/org/adempiere/process/rpl/imp/ImportHelper.java index 5694546fcd..3b9a3dfd45 100755 --- a/org.adempiere.replication/src/org/adempiere/process/rpl/imp/ImportHelper.java +++ b/org.adempiere.replication/src/org/adempiere/process/rpl/imp/ImportHelper.java @@ -36,6 +36,7 @@ import java.text.SimpleDateFormat; import java.util.Collection; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import javax.xml.xpath.XPathExpressionException; @@ -565,10 +566,10 @@ public class ImportHelper { .setParameters(value) .firstOnly(); - s_log.info("Client_Value =[" + value + "]"); + if (s_log.isLoggable(Level.INFO)) s_log.info("Client_Value =[" + value + "]"); if(result != null) { - s_log.info("AD_Client_ID = " + result.getAD_Client_ID()); + if (s_log.isLoggable(Level.INFO)) s_log.info("AD_Client_ID = " + result.getAD_Client_ID()); } return result; diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java b/org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java index 163eff3cc2..ac2c1839a3 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java @@ -20,6 +20,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; import javax.swing.JComponent; import javax.swing.JPopupMenu; @@ -60,7 +61,7 @@ public class AZoomAcross public AZoomAcross(JComponent invoker, PO po, final int windowID) { - logger.config("PO=" + po+", WindowID="+windowID); + if (logger.isLoggable(Level.CONFIG)) logger.config("PO=" + po+", WindowID="+windowID); mkZoomTargets(po, windowID); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index 88a3109ab9..2162d2fc8d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -649,10 +649,8 @@ DataStatusListener, IADTabpanel, IdSpace GridField changedField = gridTab.getField(col); String columnName = changedField.getColumnName(); ArrayList dependants = gridTab.getDependantFields(columnName); - if (logger.isLoggable(Level.CONFIG)) { - logger.config("(" + gridTab.toString() + ") " + if (logger.isLoggable(Level.CONFIG)) logger.config("(" + gridTab.toString() + ") " + columnName + " - Dependents=" + dependants.size()); - } if (dependants.size() == 0 && changedField.getCallout().length() > 0) { return; @@ -660,9 +658,8 @@ DataStatusListener, IADTabpanel, IdSpace } boolean noData = gridTab.getRowCount() == 0; - if (logger.isLoggable(Level.CONFIG)) { - logger.config(gridTab.toString() + " - Rows=" + gridTab.getRowCount()); - } + if (logger.isLoggable(Level.CONFIG)) logger.config(gridTab.toString() + " - Rows=" + gridTab.getRowCount()); + for (WEditor comp : editors) { GridField mField = comp.getGridField(); @@ -769,9 +766,7 @@ DataStatusListener, IADTabpanel, IdSpace } Events.sendEvent(this, new Event(ON_DYNAMIC_DISPLAY_EVENT, this)); - if (logger.isLoggable(Level.CONFIG)) { - logger.config(gridTab.toString() + " - fini - " + (col<=0 ? "complete" : "seletive")); - } + if (logger.isLoggable(Level.CONFIG)) logger.config(gridTab.toString() + " - fini - " + (col<=0 ? "complete" : "seletive")); } // dynamicDisplay /** @@ -1095,9 +1090,7 @@ DataStatusListener, IADTabpanel, IdSpace if (Executions.getCurrent() == null) return; int col = e.getChangedColumn(); - if (logger.isLoggable(Level.CONFIG)) { - logger.config("(" + gridTab + ") Col=" + col + ": " + e.toString()); - } + if (logger.isLoggable(Level.CONFIG)) logger.config("(" + gridTab + ") Col=" + col + ": " + e.toString()); // Process Callout GridField mField = gridTab.getField(col); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index d2d99e5883..88aef63216 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -2559,7 +2559,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements * Start Process ---- */ - logger.config("Process_ID=" + wButton.getProcess_ID() + ", Record_ID=" + record_ID); + if (logger.isLoggable(Level.CONFIG)) logger.config("Process_ID=" + wButton.getProcess_ID() + ", Record_ID=" + record_ID); if (wButton.getProcess_ID() == 0) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/WListbox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/WListbox.java index 9199ef717a..ab91a27d1f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/WListbox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/WListbox.java @@ -646,7 +646,7 @@ public class WListbox extends Listbox implements IMiniTable, TableValueChangeLis // repaint the table this.repaint(); - logger.config("Row(rs)=" + getRowCount()); + if (logger.isLoggable(Level.CONFIG)) logger.config("Row(rs)=" + getRowCount()); return; } // loadTable @@ -725,7 +725,7 @@ public class WListbox extends Listbox implements IMiniTable, TableValueChangeLis // repaint the table this.repaint(); - logger.config("Row(array)=" + getRowCount()); + if (logger.isLoggable(Level.CONFIG)) logger.config("Row(array)=" + getRowCount()); return; } // loadTable diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java index df08b1c4ac..c13a7fee9b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java @@ -19,6 +19,7 @@ package org.adempiere.webui.panel; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.component.ConfirmPanel; @@ -319,7 +320,7 @@ public class WDocActionPanel extends Window implements EventListener, Dia { int index = getSelectedIndex(); // Save Selection - logger.config("DocAction=" + s_value[index]); + if (logger.isLoggable(Level.CONFIG)) logger.config("DocAction=" + s_value[index]); gridTab.setValue("DocAction", s_value[index]); } // save diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/util/GridTabDataBinder.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/util/GridTabDataBinder.java index deed332502..8a686ab364 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/util/GridTabDataBinder.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/util/GridTabDataBinder.java @@ -13,6 +13,7 @@ package org.adempiere.webui.util; import java.util.Properties; +import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; import org.adempiere.webui.editor.WEditor; @@ -62,23 +63,23 @@ public class GridTabDataBinder implements ValueChangeListener { { if(!gridField.isEditable(true)) { - logger.config("(" + gridTab.toString() + ") " + e.getPropertyName()); + if (logger.isLoggable(Level.CONFIG)) logger.config("(" + gridTab.toString() + ") " + e.getPropertyName()); return; } } else if(!editor.isReadWrite()) { - logger.config("(" + gridTab.toString() + ") " + e.getPropertyName()); + if (logger.isLoggable(Level.CONFIG)) logger.config("(" + gridTab.toString() + ") " + e.getPropertyName()); return; } } else { - logger.config("(" + gridTab.toString() + ") " + e.getPropertyName()); + if (logger.isLoggable(Level.CONFIG)) logger.config("(" + gridTab.toString() + ") " + e.getPropertyName()); return; } } // processed - logger.config("(" + gridTab.toString() + ") " + if (logger.isLoggable(Level.CONFIG)) logger.config("(" + gridTab.toString() + ") " + e.getPropertyName() + "=" + e.getNewValue() + " (" + e.getOldValue() + ") " + (e.getOldValue() == null ? "" : e.getOldValue().getClass().getName())); diff --git a/org.adempiere.ui/src/org/compiere/print/ReportCtl.java b/org.adempiere.ui/src/org/compiere/print/ReportCtl.java index a520a283f3..3d4cb6d6ac 100644 --- a/org.adempiere.ui/src/org/compiere/print/ReportCtl.java +++ b/org.adempiere.ui/src/org/compiere/print/ReportCtl.java @@ -111,7 +111,7 @@ public class ReportCtl */ static public boolean start (IProcessUI parent, int WindowNo, ProcessInfo pi) { - s_log.info("start - " + pi); + if (s_log.isLoggable(Level.INFO)) s_log.info("start - " + pi); /** * Order Print From 74d197cb57693a63b71425debdb132068edf4e62 Mon Sep 17 00:00:00 2001 From: Richard Morales Date: Fri, 22 Feb 2013 17:17:40 -0500 Subject: [PATCH 8/8] IDEMPIERE-638 Check log level before calling logging method / logger.info+fine --- .../adempiere/exceptions/PORelationException.java | 4 +++- .../src/org/adempiere/model/MRelationType.java | 7 ++++--- .../src/org/adempiere/model/ZoomInfoFactory.java | 6 +++--- .../src/org/compiere/model/MAssetAddition.java | 1 - .../adempiere/pipo/srv/PipoDictionaryService.java | 6 +++--- .../adempiere/plugin/utils/AdempiereActivator.java | 14 +++++--------- .../src/org/compiere/apps/AZoomAcross.java | 4 ++-- .../webui/adwindow/AbstractADWindowContent.java | 11 +++++------ .../src/org/adempiere/webui/panel/ADForm.java | 3 +-- .../adempiere/webui/panel/ResetPasswordPanel.java | 3 ++- .../org/adempiere/webui/panel/WDocActionPanel.java | 4 ++-- .../src/org/adempiere/webui/window/FDialog.java | 7 ++++--- 12 files changed, 34 insertions(+), 36 deletions(-) diff --git a/org.adempiere.base/src/org/adempiere/exceptions/PORelationException.java b/org.adempiere.base/src/org/adempiere/exceptions/PORelationException.java index ef8a5d85b1..5dfcb7e371 100644 --- a/org.adempiere.base/src/org/adempiere/exceptions/PORelationException.java +++ b/org.adempiere.base/src/org/adempiere/exceptions/PORelationException.java @@ -13,6 +13,8 @@ *****************************************************************************/ package org.adempiere.exceptions; +import java.util.logging.Level; + import org.adempiere.exceptions.AdempiereException; import org.compiere.model.PO; import org.compiere.util.CLogger; @@ -68,7 +70,7 @@ public class PORelationException extends AdempiereException { public static void throwWrongKeyColumnCount(final PO po) { - logger.fine("Invoked with po " + po); + if (logger.isLoggable(Level.FINE)) logger.fine("Invoked with po " + po); final Object[] msgParams = new Object[] { po.toString(), po.get_KeyColumns().length }; diff --git a/org.adempiere.base/src/org/adempiere/model/MRelationType.java b/org.adempiere.base/src/org/adempiere/model/MRelationType.java index 1428f42ae8..4e2835bdd0 100644 --- a/org.adempiere.base/src/org/adempiere/model/MRelationType.java +++ b/org.adempiere.base/src/org/adempiere/model/MRelationType.java @@ -26,6 +26,7 @@ import java.util.HashSet; import java.util.List; import java.util.Properties; import java.util.Set; +import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; import org.adempiere.exceptions.PORelationException; @@ -143,7 +144,7 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider { final List result = evalResultSet(po, windowId, rs); - logger.info("There are " + result.size() + " matching types for " + if (logger.isLoggable(Level.INFO)) logger.info("There are " + result.size() + " matching types for " + po); return result; @@ -294,7 +295,7 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider { parsedWhere, po.get_TrxName()).first(); final boolean match = result != null; - logger.fine("whereClause='" + parsedWhere + "' matches po='" + po + if (logger.isLoggable(Level.FINE)) logger.fine("whereClause='" + parsedWhere + "' matches po='" + po + "':" + match); return match; } @@ -328,7 +329,7 @@ public class MRelationType extends X_AD_RelationType implements IZoomProvider { final String parsedWhere = Env.parseContext(privateCtx, -1, where, false); - logger.fine("whereClause='" + where + "'; parsedWhere='" + parsedWhere + if (logger.isLoggable(Level.FINE)) logger.fine("whereClause='" + where + "'; parsedWhere='" + parsedWhere + "'"); return parsedWhere; diff --git a/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java b/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java index 2223331544..6ebe25ebe4 100644 --- a/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java +++ b/org.adempiere.base/src/org/adempiere/model/ZoomInfoFactory.java @@ -95,7 +95,7 @@ public class ZoomInfoFactory { if (alreadySeen.add(zoomInfo.destinationDisplay)) { - logger.fine("Adding zoomInfo " + zoomInfo); + if (logger.isLoggable(Level.FINE)) logger.fine("Adding zoomInfo " + zoomInfo); result.add(zoomInfo); } } @@ -107,13 +107,13 @@ public class ZoomInfoFactory { if (alreadySeen.add(zoomInfo.destinationDisplay)) { - logger.fine("Adding zoomInfo " + zoomInfo + " from " + if (logger.isLoggable(Level.FINE)) logger.fine("Adding zoomInfo " + zoomInfo + " from " + GenericZoomProvider.class.getSimpleName()); result.add(zoomInfo); } else { - logger.fine("Skipping zoomInfo " + zoomInfo + " from " + if (logger.isLoggable(Level.FINE)) logger.fine("Skipping zoomInfo " + zoomInfo + " from " + GenericZoomProvider.class.getSimpleName() + " because there is already one for destination '" + zoomInfo.destinationDisplay + "'"); diff --git a/org.adempiere.base/src/org/compiere/model/MAssetAddition.java b/org.adempiere.base/src/org/compiere/model/MAssetAddition.java index d9e2c39117..1a4aa4bff8 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetAddition.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetAddition.java @@ -13,7 +13,6 @@ import org.compiere.process.DocAction; import org.compiere.process.DocumentEngine; import org.compiere.process.ProcessInfo; import org.compiere.process.ProjectClose; -import org.compiere.util.CLogMgt; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; diff --git a/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java b/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java index 3c80a19b54..eb21a799ba 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java @@ -35,7 +35,7 @@ public class PipoDictionaryService implements IDictionaryService { X_AD_Package_Imp_Proc adPackageImp = new X_AD_Package_Imp_Proc(Env.getCtx(), 0, trxName); File zipFilepath = packageFile; - logger.info("zipFilepath->" + zipFilepath); + if (logger.isLoggable(Level.INFO)) logger.info("zipFilepath->" + zipFilepath); String parentDir = Zipper.getParentDir(zipFilepath); File targetDir = new File(System.getProperty("java.io.tmpdir")); Zipper.unpackFile(zipFilepath, targetDir); @@ -43,7 +43,7 @@ public class PipoDictionaryService implements IDictionaryService { String dict_file = targetDir + File.separator + parentDir + File.separator + "dict" + File.separator + "PackOut.xml"; - logger.info("dict file->" + dict_file); + if (logger.isLoggable(Level.INFO)) logger.info("dict file->" + dict_file); // call XML Handler String msg = packIn.importXML(dict_file, Env.getCtx(), trxName); @@ -54,7 +54,7 @@ public class PipoDictionaryService implements IDictionaryService { adPackageImp.saveEx(); Trx.get(trxName, false).commit(); - logger.info("commit " + trxName); + if (logger.isLoggable(Level.INFO)) logger.info("commit " + trxName); } catch (Exception e) { logger.log(Level.SEVERE, "importXML:", e); throw e; diff --git a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java index fea64d8fde..70511dc342 100644 --- a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java +++ b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/AdempiereActivator.java @@ -25,12 +25,10 @@ public class AdempiereActivator implements BundleActivator { @Override public void start(BundleContext context) throws Exception { this.context = context; - if (logger.isLoggable(Level.INFO)) - logger.info(getName() + " " + getVersion() + " starting..."); + if (logger.isLoggable(Level.INFO)) logger.info(getName() + " " + getVersion() + " starting..."); installPackage(); start(); - if (logger.isLoggable(Level.INFO)) - logger.info(getName() + " " + getVersion() + " ready."); + if (logger.isLoggable(Level.INFO)) logger.info(getName() + " " + getVersion() + " ready."); } public String getName() { @@ -80,11 +78,9 @@ public class AdempiereActivator implements BundleActivator { if (pkg == null) { packIn(trxName); install(); - if (logger.isLoggable(Level.INFO)) - logger.info(getName() + " " + version + " installed."); + if (logger.isLoggable(Level.INFO)) logger.info(getName() + " " + version + " installed."); } else { - if (logger.isLoggable(Level.INFO)) - logger.info(getName() + " " + version + " was installed: " + if (logger.isLoggable(Level.INFO)) logger.info(getName() + " " + version + " was installed: " + pkg.getCreated()); } Trx.get(trxName, false).commit(); @@ -136,7 +132,7 @@ public class AdempiereActivator implements BundleActivator { @Override public void stop(BundleContext context) throws Exception { stop(); - logger.info(context.getBundle().getSymbolicName() + " " + if (logger.isLoggable(Level.INFO)) logger.info(context.getBundle().getSymbolicName() + " " + context.getBundle().getHeaders().get("Bundle-Version") + " stopped."); } diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java b/org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java index ac2c1839a3..5300f6d493 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/AZoomAcross.java @@ -98,7 +98,7 @@ public class AZoomAcross windowID)) { if (zoomInfo.query.getRecordCount() == 0) { - logger.fine("No target records for destination " + if (logger.isLoggable(Level.FINE)) logger.fine("No target records for destination " + zoomInfo.destinationDisplay); continue; } @@ -116,7 +116,7 @@ public class AZoomAcross final int AD_Window_ID = zoomInfo.windowId; final MQuery query = zoomInfo.query; - logger.info("AD_Window_ID=" + AD_Window_ID + if (logger.isLoggable(Level.INFO)) logger.info("AD_Window_ID=" + AD_Window_ID + " - " + query); AWindow frame = new AWindow(null); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 88aef63216..34eb649924 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -877,7 +877,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements public void onAttachment() { int record_ID = adTabbox.getSelectedGridTab().getRecord_ID(); - logger.info("Record_ID=" + record_ID); + if (logger.isLoggable(Level.INFO)) logger.info("Record_ID=" + record_ID); if (record_ID == -1) // No Key { @@ -910,7 +910,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements public void onChat() { int recordId = adTabbox.getSelectedGridTab().getRecord_ID(); - logger.info("Record_ID=" + recordId); + if (logger.isLoggable(Level.INFO)) logger.info("Record_ID=" + recordId); if (recordId== -1) // No Key { @@ -1244,8 +1244,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements if (!detailTab) { String dbInfo = e.getMessage(); - if (logger.isLoggable(Level.INFO)) - logger.info(dbInfo); + if (logger.isLoggable(Level.INFO)) logger.info(dbInfo); if (adTabbox.getSelectedGridTab() != null && adTabbox.getSelectedGridTab().isQueryActive()) dbInfo = "[ " + dbInfo + " ]"; breadCrumb.setStatusDB(dbInfo, e); @@ -2086,7 +2085,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements { Listitem li = iter.next(); if(li != null) - logger.fine((String) li.getValue()); + if (logger.isLoggable(Level.FINE)) logger.fine((String) li.getValue()); } } @@ -2325,7 +2324,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements return; } - logger.info(wButton.toString()); + if (logger.isLoggable(Level.INFO)) logger.info(wButton.toString()); final String col = wButton.getColumnName(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java index fc2d9b5349..b94f8f1415 100755 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java @@ -149,8 +149,7 @@ public abstract class ADForm extends Window implements EventListener } else { - if (logger.isLoggable(Level.INFO)) - logger.info("AD_Form_ID=" + adFormID + " - Class=" + formName); + if (logger.isLoggable(Level.INFO)) logger.info("AD_Form_ID=" + adFormID + " - Class=" + formName); form = Extensions.getForm(formName); if (form != null) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java index 96daa55333..42bff3ffa3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ResetPasswordPanel.java @@ -19,6 +19,7 @@ import java.math.BigInteger; import java.security.SecureRandom; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; import org.adempiere.util.Callback; @@ -445,7 +446,7 @@ public class ResetPasswordPanel extends Window implements EventListener user.saveEx(); if (sendEmail(user, newPassword)) - logger.fine(user.getEMail()); + if (logger.isLoggable(Level.FINE)) logger.fine(user.getEMail()); else { if (errorMsg.length() > 0) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java index c13a7fee9b..d59aacf8f9 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java @@ -111,7 +111,7 @@ public class WDocActionPanel extends Window implements EventListener, Dia return; } - logger.fine("DocStatus=" + DocStatus + if (logger.isLoggable(Level.FINE)) logger.fine("DocStatus=" + DocStatus + ", DocAction=" + DocAction + ", OrderType=" + OrderType + ", IsSOTrx=" + IsSOTrx + ", Processing=" + Processing + ", AD_Table_ID=" +gridTab.getAD_Table_ID() + ", Record_ID=" + gridTab.getRecord_ID()); @@ -164,7 +164,7 @@ public class WDocActionPanel extends Window implements EventListener, Dia if(doctypeId==null || doctypeId.intValue()==0){ doctypeId = (Integer)gridTab.getValue("C_DocTypeTarget_ID"); } - logger.fine("get doctype: " + doctypeId); + if (logger.isLoggable(Level.FINE)) logger.fine("get doctype: " + doctypeId); if (doctypeId != null) { index = DocumentEngine.checkActionAccess(Env.getAD_Client_ID(Env.getCtx()), Env.getAD_Role_ID(Env.getCtx()), diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FDialog.java index d0378cced7..ed49be70a5 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FDialog.java @@ -18,6 +18,7 @@ package org.adempiere.webui.window; import java.util.Properties; +import java.util.logging.Level; import org.compiere.util.CLogMgt; import org.compiere.util.CLogger; @@ -119,7 +120,7 @@ public class FDialog Properties ctx = Env.getCtx(); StringBuffer out = null; - logger.info(adMessage + " - " + message); + if (logger.isLoggable(Level.INFO)) logger.info(adMessage + " - " + message); out = constructMessage(adMessage, message); @@ -216,7 +217,7 @@ public class FDialog Properties ctx = Env.getCtx(); StringBuffer out = new StringBuffer(); - logger.info(adMessage + " - " + message); + if (logger.isLoggable(Level.INFO)) logger.info(adMessage + " - " + message); if (CLogMgt.isLevelFinest()) { @@ -347,7 +348,7 @@ public class FDialog StringBuffer out = new StringBuffer(); - logger.info(adMessage + " - " + message); + if (logger.isLoggable(Level.INFO)) logger.info(adMessage + " - " + message); if (CLogMgt.isLevelFinest()) {