diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutAssignment.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutAssignment.java index 943f3ee846..261275993e 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutAssignment.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutAssignment.java @@ -89,7 +89,7 @@ public class CalloutAssignment extends CalloutEngine rs = null; pstmt = null; } - log.fine("S_ResourceAssignment_ID=" + S_ResourceAssignment_ID + " - M_Product_ID=" + M_Product_ID); + if (log.isLoggable(Level.FINE)) log.fine("S_ResourceAssignment_ID=" + S_ResourceAssignment_ID + " - M_Product_ID=" + M_Product_ID); if (M_Product_ID != 0) { mTab.setValue ("M_Product_ID", new Integer (M_Product_ID)); diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutCashJournal.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutCashJournal.java index 309e754421..e7b9bf305e 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutCashJournal.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutCashJournal.java @@ -140,7 +140,7 @@ public class CalloutCashJournal extends CalloutEngine BigDecimal DiscountAmt = (BigDecimal)mTab.getValue("DiscountAmt"); BigDecimal WriteOffAmt = (BigDecimal)mTab.getValue("WriteOffAmt"); String colName = mField.getColumnName(); - log.fine(colName + " - Invoice=" + InvTotalAmt + if (log.isLoggable(Level.FINE)) log.fine(colName + " - Invoice=" + InvTotalAmt + " - Amount=" + PayAmt + ", Discount=" + DiscountAmt + ", WriteOff=" + WriteOffAmt); // Amount - calculate write off diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutGLJournal.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutGLJournal.java index 39f277d93a..048d34e40a 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutGLJournal.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutGLJournal.java @@ -177,7 +177,7 @@ public class CalloutGLJournal extends CalloutEngine BigDecimal CurrencyRate = MConversionRate.getRate(C_Currency_ID, as.getC_Currency_ID(), DateAcct, C_ConversionType_ID, AD_Client_ID, AD_Org_ID); - log.fine("rate = " + CurrencyRate); + if (log.isLoggable(Level.FINE)) log.fine("rate = " + CurrencyRate); if (CurrencyRate == null) CurrencyRate = Env.ZERO; mTab.setValue("CurrencyRate", CurrencyRate); diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java index c2e534e419..e9a0ed8da2 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInOut.java @@ -530,10 +530,10 @@ public class CalloutInOut extends CalloutEngine if (M_Warehouse_ID == loc.getM_Warehouse_ID()) mTab.setValue("M_Locator_ID", new Integer (product.getM_Locator_ID())); else - log.fine("No Locator for M_Product_ID=" + M_Product_ID + " and M_Warehouse_ID=" + M_Warehouse_ID); + if (log.isLoggable(Level.FINE)) log.fine("No Locator for M_Product_ID=" + M_Product_ID + " and M_Warehouse_ID=" + M_Warehouse_ID); } else - log.fine("No Locator for M_Product_ID=" + M_Product_ID); + if (log.isLoggable(Level.FINE)) log.fine("No Locator for M_Product_ID=" + M_Product_ID); return ""; } // product @@ -571,7 +571,7 @@ public class CalloutInOut extends CalloutEngine BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); if (QtyEntered.compareTo(QtyEntered1) != 0) { - log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + "; QtyEntered=" + QtyEntered + "->" + QtyEntered1); QtyEntered = QtyEntered1; mTab.setValue("QtyEntered", QtyEntered); @@ -581,7 +581,7 @@ public class CalloutInOut extends CalloutEngine if (MovementQty == null) MovementQty = QtyEntered; boolean conversion = QtyEntered.compareTo(MovementQty) != 0; - log.fine("UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("UOM=" + C_UOM_To_ID + ", QtyEntered=" + QtyEntered + " -> " + conversion + " MovementQty=" + MovementQty); @@ -602,7 +602,7 @@ public class CalloutInOut extends CalloutEngine BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); if (QtyEntered.compareTo(QtyEntered1) != 0) { - log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + "; QtyEntered=" + QtyEntered + "->" + QtyEntered1); QtyEntered = QtyEntered1; mTab.setValue("QtyEntered", QtyEntered); @@ -612,7 +612,7 @@ public class CalloutInOut extends CalloutEngine if (MovementQty == null) MovementQty = QtyEntered; boolean conversion = QtyEntered.compareTo(MovementQty) != 0; - log.fine("UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("UOM=" + C_UOM_To_ID + ", QtyEntered=" + QtyEntered + " -> " + conversion + " MovementQty=" + MovementQty); @@ -628,7 +628,7 @@ public class CalloutInOut extends CalloutEngine BigDecimal MovementQty1 = MovementQty.setScale(precision, BigDecimal.ROUND_HALF_UP); if (MovementQty.compareTo(MovementQty1) != 0) { - log.fine("Corrected MovementQty " + if (log.isLoggable(Level.FINE)) log.fine("Corrected MovementQty " + MovementQty + "->" + MovementQty1); MovementQty = MovementQty1; mTab.setValue("MovementQty", MovementQty); @@ -638,7 +638,7 @@ public class CalloutInOut extends CalloutEngine if (QtyEntered == null) QtyEntered = MovementQty; boolean conversion = MovementQty.compareTo(QtyEntered) != 0; - log.fine("UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("UOM=" + C_UOM_To_ID + ", MovementQty=" + MovementQty + " -> " + conversion + " QtyEntered=" + QtyEntered); @@ -669,7 +669,7 @@ public class CalloutInOut extends CalloutEngine int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID"); int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID"); int M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, "M_Locator_ID"); - log.fine("M_Product_ID=" + M_Product_ID + if (log.isLoggable(Level.FINE)) log.fine("M_Product_ID=" + M_Product_ID + ", M_ASI_ID=" + M_ASI_ID + " - M_Warehouse_ID=" + M_Warehouse_ID + ", M_Locator_ID=" + M_Locator_ID); @@ -680,7 +680,7 @@ public class CalloutInOut extends CalloutEngine int selectedM_Locator_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, Env.TAB_INFO, "M_Locator_ID"); if (selectedM_Locator_ID != 0) { - log.fine("Selected M_Locator_ID=" + selectedM_Locator_ID); + if (log.isLoggable(Level.FINE)) log.fine("Selected M_Locator_ID=" + selectedM_Locator_ID); mTab.setValue("M_Locator_ID", new Integer (selectedM_Locator_ID)); } } diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java index 2160da04ae..3ef217b696 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java @@ -439,7 +439,7 @@ public class CalloutInvoice extends CalloutEngine C_Charge_ID = ((Integer)value).intValue(); else C_Charge_ID = Env.getContextAsInt(ctx, WindowNo, "C_Charge_ID"); - log.fine("Product=" + M_Product_ID + ", C_Charge_ID=" + C_Charge_ID); + if (log.isLoggable(Level.FINE)) log.fine("Product=" + M_Product_ID + ", C_Charge_ID=" + C_Charge_ID); if (M_Product_ID == 0 && C_Charge_ID == 0) return amt (ctx, WindowNo, mTab, mField, value); // @@ -447,21 +447,21 @@ public class CalloutInvoice extends CalloutEngine int shipC_BPartner_Location_ID = Env.getContextAsInt(ctx, WindowNo, "C_BPartner_Location_ID"); if (shipC_BPartner_Location_ID == 0) return amt (ctx, WindowNo, mTab, mField, value); // - log.fine("Ship BP_Location=" + shipC_BPartner_Location_ID); + if (log.isLoggable(Level.FINE)) log.fine("Ship BP_Location=" + shipC_BPartner_Location_ID); int billC_BPartner_Location_ID = shipC_BPartner_Location_ID; - log.fine("Bill BP_Location=" + billC_BPartner_Location_ID); + if (log.isLoggable(Level.FINE)) log.fine("Bill BP_Location=" + billC_BPartner_Location_ID); // Dates Timestamp billDate = Env.getContextAsDate(ctx, WindowNo, "DateInvoiced"); - log.fine("Bill Date=" + billDate); + if (log.isLoggable(Level.FINE)) log.fine("Bill Date=" + billDate); Timestamp shipDate = billDate; - log.fine("Ship Date=" + shipDate); + if (log.isLoggable(Level.FINE)) log.fine("Ship Date=" + shipDate); int AD_Org_ID = Env.getContextAsInt(ctx, WindowNo, "AD_Org_ID"); - log.fine("Org=" + AD_Org_ID); + if (log.isLoggable(Level.FINE)) log.fine("Org=" + AD_Org_ID); int M_Warehouse_ID = Env.getContextAsInt(ctx, "#M_Warehouse_ID"); - log.fine("Warehouse=" + M_Warehouse_ID); + if (log.isLoggable(Level.FINE)) log.fine("Warehouse=" + M_Warehouse_ID); // int C_Tax_ID = Tax.get(ctx, M_Product_ID, C_Charge_ID, billDate, shipDate, @@ -503,15 +503,17 @@ public class CalloutInvoice extends CalloutEngine // get values QtyEntered = (BigDecimal)mTab.getValue("QtyEntered"); QtyInvoiced = (BigDecimal)mTab.getValue("QtyInvoiced"); - log.fine("QtyEntered=" + QtyEntered + ", Invoiced=" + QtyInvoiced + ", UOM=" + C_UOM_To_ID); + if (log.isLoggable(Level.FINE)) log.fine("QtyEntered=" + QtyEntered + ", Invoiced=" + QtyInvoiced + ", UOM=" + C_UOM_To_ID); // PriceEntered = (BigDecimal)mTab.getValue("PriceEntered"); PriceActual = (BigDecimal)mTab.getValue("PriceActual"); // Discount = (BigDecimal)mTab.getValue("Discount"); PriceLimit = (BigDecimal)mTab.getValue("PriceLimit"); PriceList = (BigDecimal)mTab.getValue("PriceList"); - log.fine("PriceList=" + PriceList + ", Limit=" + PriceLimit + ", Precision=" + StdPrecision); - log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual);// + ", Discount=" + Discount); + if (log.isLoggable(Level.FINE)){ + log.fine("PriceList=" + PriceList + ", Limit=" + PriceLimit + ", Precision=" + StdPrecision); + log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual);// + ", Discount=" + Discount); + } // No Product if ( M_Product_ID == 0 ) @@ -555,7 +557,7 @@ public class CalloutInvoice extends CalloutEngine if (PriceEntered == null) PriceEntered = pp.getPriceStd(); // - log.fine("amt - QtyChanged -> PriceActual=" + pp.getPriceStd() + if (log.isLoggable(Level.FINE)) log.fine("amt - QtyChanged -> PriceActual=" + pp.getPriceStd() + ", PriceEntered=" + PriceEntered + ", Discount=" + pp.getDiscount()); PriceActual = pp.getPriceStd(); mTab.setValue("PriceActual", pp.getPriceStd()); @@ -571,7 +573,7 @@ public class CalloutInvoice extends CalloutEngine if (PriceEntered == null) PriceEntered = PriceActual; // - log.fine("amt - PriceActual=" + PriceActual + if (log.isLoggable(Level.FINE)) log.fine("amt - PriceActual=" + PriceActual + " -> PriceEntered=" + PriceEntered); mTab.setValue("PriceEntered", PriceEntered); } @@ -583,7 +585,7 @@ public class CalloutInvoice extends CalloutEngine if (PriceActual == null) PriceActual = PriceEntered; // - log.fine("amt - PriceEntered=" + PriceEntered + if (log.isLoggable(Level.FINE)) log.fine("amt - PriceEntered=" + PriceEntered + " -> PriceActual=" + PriceActual); mTab.setValue("PriceActual", PriceActual); } @@ -629,7 +631,7 @@ public class CalloutInvoice extends CalloutEngine C_UOM_To_ID, PriceLimit); if (PriceEntered == null) PriceEntered = PriceLimit; - log.fine("amt =(under) PriceEntered=" + PriceEntered + ", Actual" + PriceLimit); + if (log.isLoggable(Level.FINE)) log.fine("amt =(under) PriceEntered=" + PriceEntered + ", Actual" + PriceLimit); mTab.setValue ("PriceActual", PriceLimit); mTab.setValue ("PriceEntered", PriceEntered); mTab.fireDataStatusEEvent ("UnderLimitPrice", "", false); @@ -735,7 +737,7 @@ public class CalloutInvoice extends CalloutEngine BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); if (QtyEntered.compareTo(QtyEntered1) != 0) { - log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + "; QtyEntered=" + QtyEntered + "->" + QtyEntered1); QtyEntered = QtyEntered1; mTab.setValue("QtyEntered", QtyEntered); @@ -750,7 +752,7 @@ public class CalloutInvoice extends CalloutEngine C_UOM_To_ID, PriceActual); if (PriceEntered == null) PriceEntered = PriceActual; - log.fine("qty - UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("qty - UOM=" + C_UOM_To_ID + ", QtyEntered/PriceActual=" + QtyEntered + "/" + PriceActual + " -> " + conversion + " QtyInvoiced/PriceEntered=" + QtyInvoiced + "/" + PriceEntered); @@ -766,7 +768,7 @@ public class CalloutInvoice extends CalloutEngine BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); if (QtyEntered.compareTo(QtyEntered1) != 0) { - log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + "; QtyEntered=" + QtyEntered + "->" + QtyEntered1); QtyEntered = QtyEntered1; mTab.setValue("QtyEntered", QtyEntered); @@ -776,7 +778,7 @@ public class CalloutInvoice extends CalloutEngine if (QtyInvoiced == null) QtyInvoiced = QtyEntered; boolean conversion = QtyEntered.compareTo(QtyInvoiced) != 0; - log.fine("qty - UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("qty - UOM=" + C_UOM_To_ID + ", QtyEntered=" + QtyEntered + " -> " + conversion + " QtyInvoiced=" + QtyInvoiced); @@ -792,7 +794,7 @@ public class CalloutInvoice extends CalloutEngine BigDecimal QtyInvoiced1 = QtyInvoiced.setScale(precision, BigDecimal.ROUND_HALF_UP); if (QtyInvoiced.compareTo(QtyInvoiced1) != 0) { - log.fine("Corrected QtyInvoiced Scale " + if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyInvoiced Scale " + QtyInvoiced + "->" + QtyInvoiced1); QtyInvoiced = QtyInvoiced1; mTab.setValue("QtyInvoiced", QtyInvoiced); @@ -802,7 +804,7 @@ public class CalloutInvoice extends CalloutEngine if (QtyEntered == null) QtyEntered = QtyInvoiced; boolean conversion = QtyInvoiced.compareTo(QtyEntered) != 0; - log.fine("qty - UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("qty - UOM=" + C_UOM_To_ID + ", QtyInvoiced=" + QtyInvoiced + " -> " + conversion + " QtyEntered=" + QtyEntered); diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoiceBatch.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoiceBatch.java index 49f5f6dd06..12c51fc002 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoiceBatch.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoiceBatch.java @@ -298,7 +298,7 @@ public class CalloutInvoiceBatch extends CalloutEngine C_Charge_ID = ((Integer)value).intValue(); else C_Charge_ID = Env.getContextAsInt(ctx, WindowNo, "C_Charge_ID"); - log.fine("C_Charge_ID=" + C_Charge_ID); + if (log.isLoggable(Level.FINE)) log.fine("C_Charge_ID=" + C_Charge_ID); if (C_Charge_ID == 0) return amt (ctx, WindowNo, mTab, mField, value); // @@ -306,19 +306,19 @@ public class CalloutInvoiceBatch extends CalloutEngine int C_BPartner_Location_ID = Env.getContextAsInt(ctx, WindowNo, "C_BPartner_Location_ID"); if (C_BPartner_Location_ID == 0) return amt (ctx, WindowNo, mTab, mField, value); // - log.fine("BP_Location=" + C_BPartner_Location_ID); + if (log.isLoggable(Level.FINE)) log.fine("BP_Location=" + C_BPartner_Location_ID); // Dates Timestamp billDate = Env.getContextAsDate(ctx, WindowNo, "DateInvoiced"); - log.fine("Bill Date=" + billDate); + if (log.isLoggable(Level.FINE)) log.fine("Bill Date=" + billDate); Timestamp shipDate = billDate; - log.fine("Ship Date=" + shipDate); + if (log.isLoggable(Level.FINE)) log.fine("Ship Date=" + shipDate); int AD_Org_ID = Env.getContextAsInt(ctx, WindowNo, "AD_Org_ID"); - log.fine("Org=" + AD_Org_ID); + if (log.isLoggable(Level.FINE)) log.fine("Org=" + AD_Org_ID); int M_Warehouse_ID = Env.getContextAsInt(ctx, "#M_Warehouse_ID"); - log.fine("Warehouse=" + M_Warehouse_ID); + if (log.isLoggable(Level.FINE)) log.fine("Warehouse=" + M_Warehouse_ID); // int C_Tax_ID = Tax.get(ctx, 0, C_Charge_ID, billDate, shipDate, @@ -356,7 +356,7 @@ public class CalloutInvoiceBatch extends CalloutEngine // get values BigDecimal QtyEntered = (BigDecimal)mTab.getValue("QtyEntered"); BigDecimal PriceEntered = (BigDecimal)mTab.getValue("PriceEntered"); - log.fine("QtyEntered=" + QtyEntered + ", PriceEntered=" + PriceEntered); + if (log.isLoggable(Level.FINE)) log.fine("QtyEntered=" + QtyEntered + ", PriceEntered=" + PriceEntered); if (QtyEntered == null) QtyEntered = Env.ZERO; if (PriceEntered == null) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java index 1498491f5d..1101a2595f 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java @@ -945,7 +945,7 @@ public class CalloutOrder extends CalloutEngine C_Charge_ID = ((Integer)value).intValue(); else C_Charge_ID = Env.getContextAsInt(ctx, WindowNo, "C_Charge_ID"); - log.fine("Product=" + M_Product_ID + ", C_Charge_ID=" + C_Charge_ID); + if (log.isLoggable(Level.FINE)) log.fine("Product=" + M_Product_ID + ", C_Charge_ID=" + C_Charge_ID); if (M_Product_ID == 0 && C_Charge_ID == 0) return amt(ctx, WindowNo, mTab, mField, value); // @@ -957,25 +957,25 @@ public class CalloutOrder extends CalloutEngine shipC_BPartner_Location_ID = Env.getContextAsInt(ctx, WindowNo, "C_BPartner_Location_ID"); if (shipC_BPartner_Location_ID == 0) return amt(ctx, WindowNo, mTab, mField, value); // - log.fine("Ship BP_Location=" + shipC_BPartner_Location_ID); + if (log.isLoggable(Level.FINE)) log.fine("Ship BP_Location=" + shipC_BPartner_Location_ID); // Timestamp billDate = Env.getContextAsDate(ctx, WindowNo, "DateOrdered"); - log.fine("Bill Date=" + billDate); + if (log.isLoggable(Level.FINE)) log.fine("Bill Date=" + billDate); Timestamp shipDate = Env.getContextAsDate(ctx, WindowNo, "DatePromised"); - log.fine("Ship Date=" + shipDate); + if (log.isLoggable(Level.FINE)) log.fine("Ship Date=" + shipDate); int AD_Org_ID = Env.getContextAsInt(ctx, WindowNo, "AD_Org_ID"); - log.fine("Org=" + AD_Org_ID); + if (log.isLoggable(Level.FINE)) log.fine("Org=" + AD_Org_ID); int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID"); - log.fine("Warehouse=" + M_Warehouse_ID); + if (log.isLoggable(Level.FINE)) log.fine("Warehouse=" + M_Warehouse_ID); int billC_BPartner_Location_ID = Env.getContextAsInt(ctx, WindowNo, "Bill_Location_ID"); if (billC_BPartner_Location_ID == 0) billC_BPartner_Location_ID = shipC_BPartner_Location_ID; - log.fine("Bill BP_Location=" + billC_BPartner_Location_ID); + if (log.isLoggable(Level.FINE)) log.fine("Bill BP_Location=" + billC_BPartner_Location_ID); // int C_Tax_ID = Tax.get (ctx, M_Product_ID, C_Charge_ID, billDate, shipDate, @@ -1020,15 +1020,17 @@ public class CalloutOrder extends CalloutEngine // get values QtyEntered = (BigDecimal)mTab.getValue("QtyEntered"); QtyOrdered = (BigDecimal)mTab.getValue("QtyOrdered"); - log.fine("QtyEntered=" + QtyEntered + ", Ordered=" + QtyOrdered + ", UOM=" + C_UOM_To_ID); + if (log.isLoggable(Level.FINE)) log.fine("QtyEntered=" + QtyEntered + ", Ordered=" + QtyOrdered + ", UOM=" + C_UOM_To_ID); // PriceEntered = (BigDecimal)mTab.getValue("PriceEntered"); PriceActual = (BigDecimal)mTab.getValue("PriceActual"); Discount = (BigDecimal)mTab.getValue("Discount"); PriceLimit = (BigDecimal)mTab.getValue("PriceLimit"); PriceList = (BigDecimal)mTab.getValue("PriceList"); - log.fine("PriceList=" + PriceList + ", Limit=" + PriceLimit + ", Precision=" + StdPrecision); - log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual + ", Discount=" + Discount); + if (log.isLoggable(Level.FINE)){ + log.fine("PriceList=" + PriceList + ", Limit=" + PriceLimit + ", Precision=" + StdPrecision); + log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual + ", Discount=" + Discount); + } // No Product if (M_Product_ID == 0) @@ -1072,7 +1074,7 @@ public class CalloutOrder extends CalloutEngine if (PriceEntered == null) PriceEntered = pp.getPriceStd(); // - log.fine("QtyChanged -> PriceActual=" + pp.getPriceStd() + if (log.isLoggable(Level.FINE)) log.fine("QtyChanged -> PriceActual=" + pp.getPriceStd() + ", PriceEntered=" + PriceEntered + ", Discount=" + pp.getDiscount()); PriceActual = pp.getPriceStd(); mTab.setValue("PriceActual", pp.getPriceStd()); @@ -1088,7 +1090,7 @@ public class CalloutOrder extends CalloutEngine if (PriceEntered == null) PriceEntered = PriceActual; // - log.fine("PriceActual=" + PriceActual + if (log.isLoggable(Level.FINE)) log.fine("PriceActual=" + PriceActual + " -> PriceEntered=" + PriceEntered); mTab.setValue("PriceEntered", PriceEntered); } @@ -1100,7 +1102,7 @@ public class CalloutOrder extends CalloutEngine if (PriceActual == null) PriceActual = PriceEntered; // - log.fine("PriceEntered=" + PriceEntered + if (log.isLoggable(Level.FINE)) log.fine("PriceEntered=" + PriceEntered + " -> PriceActual=" + PriceActual); mTab.setValue("PriceActual", PriceActual); } @@ -1130,7 +1132,7 @@ public class CalloutOrder extends CalloutEngine Discount = Discount.setScale(2, BigDecimal.ROUND_HALF_UP); mTab.setValue("Discount", Discount); } - log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual + ", Discount=" + Discount); + if (log.isLoggable(Level.FINE)) log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual + ", Discount=" + Discount); // Check PriceLimit String epl = Env.getContext(ctx, WindowNo, "EnforcePriceLimit"); @@ -1146,7 +1148,7 @@ public class CalloutOrder extends CalloutEngine C_UOM_To_ID, PriceLimit); if (PriceEntered == null) PriceEntered = PriceLimit; - log.fine("(under) PriceEntered=" + PriceEntered + ", Actual" + PriceLimit); + if (log.isLoggable(Level.FINE)) log.fine("(under) PriceEntered=" + PriceEntered + ", Actual" + PriceLimit); mTab.setValue ("PriceActual", PriceLimit); mTab.setValue ("PriceEntered", PriceEntered); mTab.fireDataStatusEEvent ("UnderLimitPrice", "", false); @@ -1205,7 +1207,7 @@ public class CalloutOrder extends CalloutEngine BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); if (QtyEntered.compareTo(QtyEntered1) != 0) { - log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + "; QtyEntered=" + QtyEntered + "->" + QtyEntered1); QtyEntered = QtyEntered1; mTab.setValue("QtyEntered", QtyEntered); @@ -1220,7 +1222,7 @@ public class CalloutOrder extends CalloutEngine C_UOM_To_ID, PriceActual); if (PriceEntered == null) PriceEntered = PriceActual; - log.fine("UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("UOM=" + C_UOM_To_ID + ", QtyEntered/PriceActual=" + QtyEntered + "/" + PriceActual + " -> " + conversion + " QtyOrdered/PriceEntered=" + QtyOrdered + "/" + PriceEntered); @@ -1236,7 +1238,7 @@ public class CalloutOrder extends CalloutEngine BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP); if (QtyEntered.compareTo(QtyEntered1) != 0) { - log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyEntered Scale UOM=" + C_UOM_To_ID + "; QtyEntered=" + QtyEntered + "->" + QtyEntered1); QtyEntered = QtyEntered1; mTab.setValue("QtyEntered", QtyEntered); @@ -1246,7 +1248,7 @@ public class CalloutOrder extends CalloutEngine if (QtyOrdered == null) QtyOrdered = QtyEntered; boolean conversion = QtyEntered.compareTo(QtyOrdered) != 0; - log.fine("UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("UOM=" + C_UOM_To_ID + ", QtyEntered=" + QtyEntered + " -> " + conversion + " QtyOrdered=" + QtyOrdered); @@ -1262,7 +1264,7 @@ public class CalloutOrder extends CalloutEngine BigDecimal QtyOrdered1 = QtyOrdered.setScale(precision, BigDecimal.ROUND_HALF_UP); if (QtyOrdered.compareTo(QtyOrdered1) != 0) { - log.fine("Corrected QtyOrdered Scale " + if (log.isLoggable(Level.FINE)) log.fine("Corrected QtyOrdered Scale " + QtyOrdered + "->" + QtyOrdered1); QtyOrdered = QtyOrdered1; mTab.setValue("QtyOrdered", QtyOrdered); @@ -1272,7 +1274,7 @@ public class CalloutOrder extends CalloutEngine if (QtyEntered == null) QtyEntered = QtyOrdered; boolean conversion = QtyOrdered.compareTo(QtyEntered) != 0; - log.fine("UOM=" + C_UOM_To_ID + if (log.isLoggable(Level.FINE)) log.fine("UOM=" + C_UOM_To_ID + ", QtyOrdered=" + QtyOrdered + " -> " + conversion + " QtyEntered=" + QtyEntered); diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutPaySelection.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutPaySelection.java index 0c8ba4e251..69e413a719 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutPaySelection.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutPaySelection.java @@ -67,7 +67,7 @@ public class CalloutPaySelection extends CalloutEngine BigDecimal PayAmt = (BigDecimal)mTab.getValue("PayAmt"); BigDecimal DiscountAmt = (BigDecimal)mTab.getValue("DiscountAmt"); BigDecimal DifferenceAmt = OpenAmt.subtract(PayAmt).subtract(DiscountAmt); - log.fine(" - OpenAmt=" + OpenAmt + " - PayAmt=" + PayAmt + if (log.isLoggable(Level.FINE)) log.fine(" - OpenAmt=" + OpenAmt + " - PayAmt=" + PayAmt + ", Discount=" + DiscountAmt + ", Difference=" + DifferenceAmt); mTab.setValue("DifferenceAmt", DifferenceAmt); @@ -133,7 +133,7 @@ public class CalloutPaySelection extends CalloutEngine DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine(" - OpenAmt=" + OpenAmt + " (Invoice=" + C_Invoice_ID + ",BankAcct=" + C_BankAccount_ID + ")"); + if (log.isLoggable(Level.FINE)) log.fine(" - OpenAmt=" + OpenAmt + " (Invoice=" + C_Invoice_ID + ",BankAcct=" + C_BankAccount_ID + ")"); mTab.setValue("OpenAmt", OpenAmt); mTab.setValue("PayAmt", OpenAmt.subtract(DiscountAmt)); mTab.setValue("DiscountAmt", DiscountAmt); diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java index d731415b3c..312e495fec 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java @@ -242,7 +242,7 @@ public class CalloutPayment extends CalloutEngine int C_Invoice_ID = Env.getContextAsInt (ctx, WindowNo, "C_Invoice_ID"); int C_Order_ID = Env.getContextAsInt (ctx, WindowNo, "C_Order_ID"); int C_DocType_ID = Env.getContextAsInt (ctx, WindowNo, "C_DocType_ID"); - log.fine ("Payment_DocType - C_Invoice_ID=" + C_Invoice_ID + if (log.isLoggable(Level.FINE)) log.fine ("Payment_DocType - C_Invoice_ID=" + C_Invoice_ID + ", C_DocType_ID=" + C_DocType_ID); MDocType dt = null; if (C_DocType_ID != 0) @@ -359,14 +359,14 @@ public class CalloutPayment extends CalloutEngine pstmt = null; } } // get Invoice Info - log.fine ("Open=" + InvoiceOpenAmt + ", C_Invoice_ID=" + C_Invoice_ID + if (log.isLoggable(Level.FINE)) log.fine ("Open=" + InvoiceOpenAmt + ", C_Invoice_ID=" + C_Invoice_ID + ", C_Currency_ID=" + C_Currency_Invoice_ID); // Get Info from Tab BigDecimal PayAmt = (BigDecimal)mTab.getValue ("PayAmt"); BigDecimal DiscountAmt = (BigDecimal)mTab.getValue ("DiscountAmt"); BigDecimal WriteOffAmt = (BigDecimal)mTab.getValue ("WriteOffAmt"); BigDecimal OverUnderAmt = (BigDecimal)mTab.getValue ("OverUnderAmt"); - log.fine ("Pay=" + PayAmt + ", Discount=" + DiscountAmt + ", WriteOff=" + if (log.isLoggable(Level.FINE)) log.fine ("Pay=" + PayAmt + ", Discount=" + DiscountAmt + ", WriteOff=" + WriteOffAmt + ", OverUnderAmt=" + OverUnderAmt); // Get Currency Info int C_Currency_ID = ((Integer)mTab.getValue ("C_Currency_ID")) @@ -385,7 +385,7 @@ public class CalloutPayment extends CalloutEngine || colName.equals ("C_Currency_ID") || colName.equals ("C_ConversionType_ID")) { - log.fine ("InvCurrency=" + C_Currency_Invoice_ID + ", PayCurrency=" + if (log.isLoggable(Level.FINE)) log.fine ("InvCurrency=" + C_Currency_Invoice_ID + ", PayCurrency=" + C_Currency_ID + ", Date=" + ConvDate + ", Type=" + C_ConversionType_ID); CurrencyRate = MConversionRate.getRate (C_Currency_Invoice_ID, @@ -402,7 +402,7 @@ public class CalloutPayment extends CalloutEngine // InvoiceOpenAmt = InvoiceOpenAmt.multiply (CurrencyRate).setScale ( currency.getStdPrecision (), BigDecimal.ROUND_HALF_UP); - log.fine ("Rate=" + CurrencyRate + ", InvoiceOpenAmt=" + if (log.isLoggable(Level.FINE)) log.fine ("Rate=" + CurrencyRate + ", InvoiceOpenAmt=" + InvoiceOpenAmt); } // Currency Changed - convert all diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java index ef600b0ee9..9982b85f21 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutPaymentAllocate.java @@ -156,7 +156,7 @@ public class CalloutPaymentAllocate extends CalloutEngine BigDecimal WriteOffAmt = (BigDecimal)mTab.getValue("WriteOffAmt"); BigDecimal OverUnderAmt = (BigDecimal)mTab.getValue("OverUnderAmt"); BigDecimal InvoiceAmt = (BigDecimal)mTab.getValue("InvoiceAmt"); - log.fine("Amt=" + Amount + ", Discount=" + DiscountAmt + if (log.isLoggable(Level.FINE)) log.fine("Amt=" + Amount + ", Discount=" + DiscountAmt + ", WriteOff=" + WriteOffAmt + ", OverUnder=" + OverUnderAmt + ", Invoice=" + InvoiceAmt); diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutProject.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutProject.java index 3e41385598..0f23ed39ed 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutProject.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutProject.java @@ -18,6 +18,7 @@ package org.compiere.model; import java.math.BigDecimal; import java.util.Properties; +import java.util.logging.Level; import org.compiere.util.Env; @@ -62,7 +63,7 @@ public class CalloutProject extends CalloutEngine if (PlannedAmt.scale() > StdPrecision) PlannedAmt = PlannedAmt.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP); // - log.fine("PlannedQty=" + PlannedQty + " * PlannedPrice=" + PlannedPrice + " -> PlannedAmt=" + PlannedAmt + " (Precision=" + StdPrecision+ ")"); + if (log.isLoggable(Level.FINE)) log.fine("PlannedQty=" + PlannedQty + " * PlannedPrice=" + PlannedPrice + " -> PlannedAmt=" + PlannedAmt + " (Precision=" + StdPrecision+ ")"); mTab.setValue("PlannedAmt", PlannedAmt); return ""; } // planned diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutRequisition.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutRequisition.java index 7299f68b33..964eb888b7 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutRequisition.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutRequisition.java @@ -19,6 +19,7 @@ package org.compiere.model; import java.math.BigDecimal; import java.sql.Timestamp; import java.util.Properties; +import java.util.logging.Level; import org.adempiere.model.GridTabWrapper; import org.compiere.util.Env; @@ -82,7 +83,7 @@ public class CalloutRequisition extends CalloutEngine int StdPrecision = Env.getContextAsInt(ctx, WindowNo, "StdPrecision"); BigDecimal Qty = line.getQty(); BigDecimal PriceActual = line.getPriceActual(); - log.fine("amt - Qty=" + Qty + ", Price=" + PriceActual + ", Precision=" + StdPrecision); + if (log.isLoggable(Level.FINE)) log.fine("amt - Qty=" + Qty + ", Price=" + PriceActual + ", Precision=" + StdPrecision); // Multiply BigDecimal LineNetAmt = Qty.multiply(PriceActual); diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutTimeExpense.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutTimeExpense.java index 1cba9a246f..b26c16a5a1 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutTimeExpense.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutTimeExpense.java @@ -189,7 +189,7 @@ public class CalloutTimeExpense extends CalloutEngine int C_Currency_To_ID = Env.getContextAsInt(ctx, "$C_Currency_ID"); Timestamp DateExpense = Env.getContextAsDate(ctx, WindowNo, "DateExpense"); // - log.fine("Amt=" + ExpenseAmt + ", C_Currency_ID=" + C_Currency_From_ID); + if (log.isLoggable(Level.FINE)) log.fine("Amt=" + ExpenseAmt + ", C_Currency_ID=" + C_Currency_From_ID); // Converted Amount = Unit price BigDecimal ConvertedAmt = ExpenseAmt; // convert if required @@ -202,7 +202,7 @@ public class CalloutTimeExpense extends CalloutEngine DateExpense, 0, AD_Client_ID, AD_Org_ID); } mTab.setValue("ConvertedAmt", ConvertedAmt); - log.fine("= ConvertedAmt=" + ConvertedAmt); + if (log.isLoggable(Level.FINE)) log.fine("= ConvertedAmt=" + ConvertedAmt); return ""; } // Expense_Amount diff --git a/org.adempiere.base.process/src/org/compiere/process/Aging.java b/org.adempiere.base.process/src/org/compiere/process/Aging.java index 0d75a29f9e..270fea7343 100644 --- a/org.adempiere.base.process/src/org/compiere/process/Aging.java +++ b/org.adempiere.base.process/src/org/compiere/process/Aging.java @@ -221,7 +221,7 @@ public class Aging extends SvrProcess if (aging != null) { aging.saveEx(); - log.fine("#" + ++counter + " - " + aging); + if (log.isLoggable(Level.FINE)) log.fine("#" + ++counter + " - " + aging); } aging = new MAging (getCtx(), AD_PInstance_ID, p_StatementDate, C_BPartner_ID, C_Currency_ID, @@ -239,7 +239,7 @@ public class Aging extends SvrProcess { aging.saveEx(); counter++; - log.fine("#" + counter + " - " + aging); + if (log.isLoggable(Level.FINE)) log.fine("#" + counter + " - " + aging); } } catch (SQLException e) diff --git a/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java b/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java index b8cbe3d946..416c9c5e56 100644 --- a/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java +++ b/org.adempiere.base.process/src/org/compiere/process/AllocationAuto.java @@ -375,7 +375,7 @@ public class AllocationAuto extends SvrProcess .add(payment.getOverUnderAmt()); if (!payment.isReceipt()) availableAmt = availableAmt.negate(); - log.fine("Available=" + availableAmt); + if (log.isLoggable(Level.FINE)) log.fine("Available=" + availableAmt); // if (payment.getC_Invoice_ID() != 0) { @@ -392,7 +392,7 @@ public class AllocationAuto extends SvrProcess BigDecimal openAmt = invoice.getOpenAmt(true, null); if (!invoice.isSOTrx()) openAmt = openAmt.negate(); - log.fine(invoice + ", Open=" + openAmt); + if (log.isLoggable(Level.FINE)) log.fine(invoice + ", Open=" + openAmt); // With Discount, etc. if (availableAmt.compareTo(openAmt) == 0) { @@ -432,7 +432,7 @@ public class AllocationAuto extends SvrProcess .subtract(line.getDifferenceAmt()).subtract(overUnder); if (!invoice.isSOTrx()) invoiceAmt = invoiceAmt.negate(); - log.fine(invoice + ", Invoice=" + invoiceAmt); + if (log.isLoggable(Level.FINE)) log.fine(invoice + ", Invoice=" + invoiceAmt); totalInvoice = totalInvoice.add(invoiceAmt); } else // Multi-Currency @@ -478,7 +478,7 @@ public class AllocationAuto extends SvrProcess .add(payment.getOverUnderAmt()); if (!payment.isReceipt()) availableAmt = availableAmt.negate(); - log.fine("Available=" + availableAmt); + if (log.isLoggable(Level.FINE)) log.fine("Available=" + availableAmt); for (int i = 0; i < m_invoices.length; i++) { MInvoice invoice = m_invoices[i]; @@ -491,7 +491,7 @@ public class AllocationAuto extends SvrProcess if (!invoice.isSOTrx()) openAmt = openAmt.negate(); BigDecimal difference = availableAmt.subtract(openAmt).abs(); - log.fine(invoice + ", Open=" + openAmt + " - Difference=" + difference); + if (log.isLoggable(Level.FINE)) log.fine(invoice + ", Open=" + openAmt + " - Difference=" + difference); if (difference.signum() == 0) { Timestamp dateAcct = payment.getDateAcct(); @@ -657,7 +657,7 @@ public class AllocationAuto extends SvrProcess availableAmt = availableAmt.subtract(allocatedAmt); if (!payment.isReceipt()) availableAmt = availableAmt.negate(); - log.fine("Available=" + availableAmt); + if (log.isLoggable(Level.FINE)) log.fine("Available=" + availableAmt); if (dateAcct == null || payment.getDateAcct().after(dateAcct)) dateAcct = payment.getDateAcct(); totalPayments = totalPayments.add(availableAmt); @@ -672,11 +672,11 @@ public class AllocationAuto extends SvrProcess if (invoice.getC_Currency_ID() != C_Currency_ID) continue; BigDecimal openAmt = invoice.getOpenAmt(true, null); - log.fine("" + invoice); + if (log.isLoggable(Level.FINE)) log.fine("" + invoice); if (!invoice.isSOTrx()) openAmt = openAmt.negate(); // Foreign currency - log.fine("Open=" + openAmt); + if (log.isLoggable(Level.FINE)) log.fine("Open=" + openAmt); if (dateAcct == null || invoice.getDateAcct().after(dateAcct)) dateAcct = invoice.getDateAcct(); totalInvoices = totalInvoices.add(openAmt); @@ -685,7 +685,7 @@ public class AllocationAuto extends SvrProcess // must be either AP or AR balance if (totalInvoices.signum() != totalPayments.signum()) { - log.fine("Signum - Invoices=" + totalInvoices.signum() + if (log.isLoggable(Level.FINE)) log.fine("Signum - Invoices=" + totalInvoices.signum() + " <> Payments=" + totalPayments.signum()); return 0; } @@ -727,7 +727,7 @@ public class AllocationAuto extends SvrProcess availableAmt = availableAmt.subtract(diff); allocatedPayments = allocatedPayments.subtract(diff); } - log.fine("Payment Allocated=" + availableAmt); + if (log.isLoggable(Level.FINE)) log.fine("Payment Allocated=" + availableAmt); if (!createAllocation(C_Currency_ID, "BP Oldest (" + difference.abs() + ")", dateAcct, availableAmt, null, null, null, payment.getC_BPartner_ID(), payment.getC_Payment_ID(), 0, payment.getAD_Org_ID())) @@ -759,7 +759,7 @@ public class AllocationAuto extends SvrProcess } if (openAmt.signum() == 0) break; - log.fine("Invoice Allocated=" + openAmt); + if (log.isLoggable(Level.FINE)) log.fine("Invoice Allocated=" + openAmt); if (!createAllocation(C_Currency_ID, "BP Oldest (" + difference.abs() + ")", dateAcct, openAmt, null, null, null, invoice.getC_BPartner_ID(), 0, invoice.getC_Invoice_ID(), invoice.getAD_Org_ID())) diff --git a/org.adempiere.base.process/src/org/compiere/process/AllocationReset.java b/org.adempiere.base.process/src/org/compiere/process/AllocationReset.java index acce4872ff..251ca03df1 100644 --- a/org.adempiere.base.process/src/org/compiere/process/AllocationReset.java +++ b/org.adempiere.base.process/src/org/compiere/process/AllocationReset.java @@ -59,7 +59,7 @@ public class AllocationReset extends SvrProcess ProcessInfoParameter[] para = getParameter(); for (int i = 0; i < para.length; i++) { - log.fine("prepare - " + para[i]); + if (log.isLoggable(Level.FINE)) log.fine("prepare - " + para[i]); String name = para[i].getParameterName(); if (para[i].getParameter() == null && para[i].getParameter_To() == null) ; @@ -183,7 +183,7 @@ public class AllocationReset extends SvrProcess boolean success = false; if (hdr.delete(true, m_trx.getTrxName())) { - log.fine(hdr.toString()); + if (log.isLoggable(Level.FINE)) log.fine(hdr.toString()); success = true; } if (success) diff --git a/org.adempiere.base.process/src/org/compiere/process/AssetDelivery.java b/org.adempiere.base.process/src/org/compiere/process/AssetDelivery.java index 0aa97ce1d6..6eee91b0db 100644 --- a/org.adempiere.base.process/src/org/compiere/process/AssetDelivery.java +++ b/org.adempiere.base.process/src/org/compiere/process/AssetDelivery.java @@ -235,7 +235,7 @@ public class AssetDelivery extends SvrProcess */ private String deliverIt (int A_Asset_ID) { - log.fine("A_Asset_ID=" + A_Asset_ID); + if (log.isLoggable(Level.FINE)) log.fine("A_Asset_ID=" + A_Asset_ID); long start = System.currentTimeMillis(); // MAsset asset = new MAsset (getCtx(), A_Asset_ID, get_TrxName()); @@ -297,7 +297,7 @@ public class AssetDelivery extends SvrProcess ad.saveEx(); asset.saveEx(); // - log.fine((System.currentTimeMillis()-start) + " ms"); + if (log.isLoggable(Level.FINE)) log.fine((System.currentTimeMillis()-start) + " ms"); // success StringBuilder msgreturn = new StringBuilder().append(user.getEMail()).append(" - ").append(asset.getVersionNo()); return msgreturn.toString(); diff --git a/org.adempiere.base.process/src/org/compiere/process/BOMValidate.java b/org.adempiere.base.process/src/org/compiere/process/BOMValidate.java index 366a9483a1..8a63a171cf 100644 --- a/org.adempiere.base.process/src/org/compiere/process/BOMValidate.java +++ b/org.adempiere.base.process/src/org/compiere/process/BOMValidate.java @@ -183,7 +183,7 @@ public class BOMValidate extends SvrProcess return false; } m_products.add(product); - log.fine(product.getName()); + if (log.isLoggable(Level.FINE)) log.fine(product.getName()); // MProductBOM[] productsBOMs = MProductBOM.getBOMLines(product); for (int i = 0; i < productsBOMs.length; i++) @@ -242,7 +242,7 @@ public class BOMValidate extends SvrProcess return false; } m_products.add(product); - log.fine(product.getName()); + if (log.isLoggable(Level.FINE)) log.fine(product.getName()); // MBOM bom = boms[0]; MBOMProduct[] BOMproducts = MBOMProduct.getOfBOM(bom); diff --git a/org.adempiere.base.process/src/org/compiere/process/BankStatementMatcher.java b/org.adempiere.base.process/src/org/compiere/process/BankStatementMatcher.java index 64c13d3888..5efe1baf32 100644 --- a/org.adempiere.base.process/src/org/compiere/process/BankStatementMatcher.java +++ b/org.adempiere.base.process/src/org/compiere/process/BankStatementMatcher.java @@ -88,7 +88,7 @@ public class BankStatementMatcher extends SvrProcess if (m_matchers == null || ibs == null || ibs.getC_Payment_ID() != 0) return "--"; - log.fine("" + ibs); + if (log.isLoggable(Level.FINE)) log.fine("" + ibs); BankStatementMatchInfo info = null; for (int i = 0; i < m_matchers.length; i++) { @@ -122,7 +122,7 @@ public class BankStatementMatcher extends SvrProcess if (m_matchers == null || bsl == null || bsl.getC_Payment_ID() != 0) return "--"; - log.fine("match - " + bsl); + if (log.isLoggable(Level.FINE)) log.fine("match - " + bsl); BankStatementMatchInfo info = null; for (int i = 0; i < m_matchers.length; i++) { @@ -154,7 +154,7 @@ public class BankStatementMatcher extends SvrProcess { if (m_matchers == null || bs == null) return "--"; - log.fine("match - " + bs); + if (log.isLoggable(Level.FINE)) log.fine("match - " + bs); int count = 0; MBankStatementLine[] lines = bs.getLines(false); for (int i = 0; i < lines.length; i++) diff --git a/org.adempiere.base.process/src/org/compiere/process/BankStatementPayment.java b/org.adempiere.base.process/src/org/compiere/process/BankStatementPayment.java index f51b0efd05..2309f053fa 100644 --- a/org.adempiere.base.process/src/org/compiere/process/BankStatementPayment.java +++ b/org.adempiere.base.process/src/org/compiere/process/BankStatementPayment.java @@ -83,7 +83,7 @@ public class BankStatementPayment extends SvrProcess { if (ibs == null || ibs.getC_Payment_ID() != 0) return "--"; - log.fine(ibs.toString()); + if (log.isLoggable(Level.FINE)) log.fine(ibs.toString()); if (ibs.getC_Invoice_ID() == 0 && ibs.getC_BPartner_ID() == 0) throw new AdempiereUserError ("@NotFound@ @C_Invoice_ID@ / @C_BPartner_ID@"); if (ibs.getC_BankAccount_ID() == 0) @@ -117,7 +117,7 @@ public class BankStatementPayment extends SvrProcess { if (bsl == null || bsl.getC_Payment_ID() != 0) return "--"; - log.fine(bsl.toString()); + if (log.isLoggable(Level.FINE)) log.fine(bsl.toString()); if (bsl.getC_Invoice_ID() == 0 && bsl.getC_BPartner_ID() == 0) throw new AdempiereUserError ("@NotFound@ @C_Invoice_ID@ / @C_BPartner_ID@"); // diff --git a/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java b/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java index f9f1dd639e..6f5aca576c 100644 --- a/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java +++ b/org.adempiere.base.process/src/org/compiere/process/CommissionCalc.java @@ -241,7 +241,7 @@ public class CommissionCalc extends SvrProcess if (!m_com.isListDetails()) sql.append(" GROUP BY h.C_Currency_ID"); // - log.fine("Line=" + lines[i].getLine() + " - " + sql); + if (log.isLoggable(Level.FINE)) log.fine("Line=" + lines[i].getLine() + " - " + sql); // createDetail(sql.toString(), comAmt); comAmt.calculateCommission(); @@ -319,7 +319,7 @@ public class CommissionCalc extends SvrProcess cal.add(Calendar.DAY_OF_YEAR, -1); m_EndDate = new Timestamp (cal.getTimeInMillis()); } - log.fine("setStartEndDate = " + p_StartDate + " - " + m_EndDate); + if (log.isLoggable(Level.FINE)) log.fine("setStartEndDate = " + p_StartDate + " - " + m_EndDate); /** String sd = DB.TO_DATE(p_StartDate, true); diff --git a/org.adempiere.base.process/src/org/compiere/process/DistributionRun.java b/org.adempiere.base.process/src/org/compiere/process/DistributionRun.java index e64142fa69..491e1b91ba 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DistributionRun.java +++ b/org.adempiere.base.process/src/org/compiere/process/DistributionRun.java @@ -237,7 +237,7 @@ public class DistributionRun extends SvrProcess // Delete Old sql = "DELETE FROM T_DistributionRunDetail WHERE M_DistributionRun_ID=?"; no = DB.executeUpdateEx(sql,new Object[]{p_M_DistributionRun_ID}, get_TrxName()); - log.fine("insertDetails - deleted #" + no); + if (log.isLoggable(Level.FINE)) log.fine("insertDetails - deleted #" + no); // Insert New sql = "INSERT INTO T_DistributionRunDetail " + "(M_DistributionRun_ID, M_DistributionRunLine_ID, M_DistributionList_ID, M_DistributionListLine_ID," @@ -258,7 +258,7 @@ public class DistributionRun extends SvrProcess + "WHERE rl.M_DistributionRun_ID=?" + " AND l.RatioTotal<>0 AND rl.IsActive='Y' AND ll.IsActive='Y'"; no = DB.executeUpdateEx(sql,new Object[]{p_M_DistributionRun_ID}, get_TrxName()); - log.fine("inserted #" + no); + if (log.isLoggable(Level.FINE)) log.fine("inserted #" + no); return no; } // insertDetails @@ -291,7 +291,7 @@ public class DistributionRun extends SvrProcess runLine.addActualAllocation(detail.getActualAllocation()); runLine.setMaxAllocation(detail.getActualAllocation(), false); // - log.fine("RunLine=" + runLine.getLine() + if (log.isLoggable(Level.FINE)) log.fine("RunLine=" + runLine.getLine() + ": BP_ID=" + detail.getC_BPartner_ID() + ", Min=" + detail.getMinQty() + ", Qty=" + detail.getQty() @@ -305,7 +305,7 @@ public class DistributionRun extends SvrProcess for (int j = 0; j < m_runLines.length; j++) { MDistributionRunLine runLine = m_runLines[j]; - log.fine("Run - " + runLine.getInfo()); + if (log.isLoggable(Level.FINE)) log.fine("Run - " + runLine.getInfo()); } } // addAllocations @@ -360,7 +360,7 @@ public class DistributionRun extends SvrProcess // Adjust when difference is -1->1 or last difference is the same boolean adjustBiggest = difference.abs().compareTo(Env.ONE) <= 0 || difference.abs().compareTo(runLine.getLastDifference().abs()) == 0; - log.fine("Line=" + runLine.getLine() + if (log.isLoggable(Level.FINE)) log.fine("Line=" + runLine.getLine() + ", Diff=" + difference + ", Adjust=" + adjustBiggest); // Adjust Biggest Amount if (adjustBiggest) @@ -370,7 +370,7 @@ public class DistributionRun extends SvrProcess MDistributionRunDetail detail = m_details[i]; if (runLine.getM_DistributionRunLine_ID() == detail.getM_DistributionRunLine_ID()) { - log.fine("Biggest - DetailAllocation=" + detail.getActualAllocation() + if (log.isLoggable(Level.FINE)) log.fine("Biggest - DetailAllocation=" + detail.getActualAllocation() + ", MaxAllocation=" + runLine.getMaxAllocation() + ", Qty Difference=" + difference); if (detail.getActualAllocation().compareTo(runLine.getMaxAllocation()) == 0 @@ -414,7 +414,7 @@ public class DistributionRun extends SvrProcess { BigDecimal diffRatio = detail.getRatio().multiply(difference) .divide(ratioTotal, BigDecimal.ROUND_HALF_UP); // precision from total - log.fine("Detail=" + detail.toString() + if (log.isLoggable(Level.FINE)) log.fine("Detail=" + detail.toString() + ", Allocation=" + detail.getActualAllocation() + ", DiffRatio=" + diffRatio); detail.adjustQty(diffRatio); @@ -450,7 +450,7 @@ public class DistributionRun extends SvrProcess + " - " + m_docType); log.info("Single=" + m_run.isCreateSingleOrder() + " - " + m_docType + ",SO=" + m_docType.isSOTrx()); - log.fine("Counter=" + counter + if (log.isLoggable(Level.FINE)) log.fine("Counter=" + counter + ",C_BPartner_ID=" + runC_BPartner_ID + "," + runBPartner); // MBPartner bp = null; @@ -517,7 +517,7 @@ public class DistributionRun extends SvrProcess // Counter Doc if (counter && bp.getAD_OrgBP_ID_Int() > 0) { - log.fine("Counter - From_BPOrg=" + bp.getAD_OrgBP_ID_Int() + if (log.isLoggable(Level.FINE)) log.fine("Counter - From_BPOrg=" + bp.getAD_OrgBP_ID_Int() + "-" + bp + ", To_BP=" + runBPartner); order.setAD_Org_ID(bp.getAD_OrgBP_ID_Int()); MOrgInfo oi = MOrgInfo.get(getCtx(), bp.getAD_OrgBP_ID_Int(), get_TrxName()); @@ -527,7 +527,7 @@ public class DistributionRun extends SvrProcess } else // normal { - log.fine("From_Org=" + runAD_Org_ID + if (log.isLoggable(Level.FINE)) log.fine("From_Org=" + runAD_Org_ID + ", To_BP=" + bp); order.setAD_Org_ID(runAD_Org_ID); order.setBPartner(bp); @@ -601,7 +601,7 @@ public class DistributionRun extends SvrProcess sql = new StringBuilder("DELETE FROM T_DistributionRunDetail WHERE M_DistributionRun_ID=") .append(p_M_DistributionRun_ID); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("insertDetails - deleted #" + no); + if (log.isLoggable(Level.FINE)) log.fine("insertDetails - deleted #" + no); // Insert New sql = new StringBuilder("INSERT INTO T_DistributionRunDetail ") @@ -648,7 +648,7 @@ public class DistributionRun extends SvrProcess record.setQty(drl.getTotalQty().multiply(factor)); record.saveEx(); } - log.fine("inserted #" + no); + if (log.isLoggable(Level.FINE)) log.fine("inserted #" + no); return no; } // insertDetails @@ -713,7 +713,7 @@ public class DistributionRun extends SvrProcess sql = new StringBuilder("DELETE FROM T_DistributionRunDetail WHERE M_DistributionRun_ID=") .append(p_M_DistributionRun_ID); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("insertDetails - deleted #" + no); + if (log.isLoggable(Level.FINE)) log.fine("insertDetails - deleted #" + no); // Insert New sql = new StringBuilder("INSERT INTO T_DistributionRunDetail ") @@ -752,7 +752,7 @@ public class DistributionRun extends SvrProcess record.setQty(factor.multiply(drl.getTotalQty())); record.saveEx(); } - log.fine("inserted #" + no); + if (log.isLoggable(Level.FINE)) log.fine("inserted #" + no); return no; } // insertDetails @@ -848,7 +848,7 @@ public class DistributionRun extends SvrProcess + " - " + m_docType); log.info("Single=" + m_run.isCreateSingleOrder() + " - " + m_docType + ",SO=" + m_docType.isSOTrx()); - log.fine("Counter=" + counter + if (log.isLoggable(Level.FINE)) log.fine("Counter=" + counter + ",C_BPartner_ID=" + runC_BPartner_ID + "," + runBPartner); // MBPartner bp = null; @@ -965,7 +965,7 @@ public class DistributionRun extends SvrProcess // Counter Doc if (counter && bp.getAD_OrgBP_ID_Int() > 0) { - log.fine("Counter - From_BPOrg=" + bp.getAD_OrgBP_ID_Int() + if (log.isLoggable(Level.FINE)) log.fine("Counter - From_BPOrg=" + bp.getAD_OrgBP_ID_Int() + "-" + bp + ", To_BP=" + runBPartner); order.setAD_Org_ID(bp.getAD_OrgBP_ID_Int()); if (ws[0].getM_Warehouse_ID() > 0) @@ -974,7 +974,7 @@ public class DistributionRun extends SvrProcess } else // normal { - log.fine("From_Org=" + runAD_Org_ID + if (log.isLoggable(Level.FINE)) log.fine("From_Org=" + runAD_Org_ID + ", To_BP=" + bp); order.setAD_Org_ID(bp.getAD_OrgBP_ID_Int()); order.setBPartner(bp); diff --git a/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java b/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java index 2ce7c03734..c3dbf29e9a 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java +++ b/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java @@ -199,7 +199,7 @@ public class DunningPrint extends SvrProcess if (re != null) { File attachment = re.getPDF(File.createTempFile("Dunning", ".pdf")); StringBuilder msglog = new StringBuilder().append(to.toString()).append(" - ").append(attachment); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); email.addAttachment(attachment); } // diff --git a/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java b/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java index da4c05ddfb..941f813f7f 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/DunningRunCreate.java @@ -234,12 +234,12 @@ public class DunningRunCreate extends SvrProcess StringBuilder msglog = new StringBuilder() .append("DaysAfterDue: ").append(DaysAfterDue.intValue()).append(" isShowAllDue: ").append(level.isShowAllDue()); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); msglog = new StringBuilder() .append("C_Invoice_ID - DaysDue - GrandTotal: ").append(C_Invoice_ID).append(" - ").append(DaysDue).append(" - ").append(GrandTotal); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); msglog = new StringBuilder("C_InvoicePaySchedule_ID: ").append(C_InvoicePaySchedule_ID); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); // // Check for Dispute if (!p_IncludeInDispute && IsInDispute) diff --git a/org.adempiere.base.process/src/org/compiere/process/ExpenseSOrder.java b/org.adempiere.base.process/src/org/compiere/process/ExpenseSOrder.java index 70ef7e9c6e..024173c291 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ExpenseSOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/ExpenseSOrder.java @@ -257,7 +257,7 @@ public class ExpenseSOrder extends SvrProcess // Update TimeExpense Line tel.setC_OrderLine_ID(ol.getC_OrderLine_ID()); if (tel.save()) - log.fine("Updated " + tel + " with C_OrderLine_ID"); + if (log.isLoggable(Level.FINE)) log.fine("Updated " + tel + " with C_OrderLine_ID"); else log.log(Level.SEVERE, "Not Updated " + tel + " with C_OrderLine_ID"); diff --git a/org.adempiere.base.process/src/org/compiere/process/FactAcctReset.java b/org.adempiere.base.process/src/org/compiere/process/FactAcctReset.java index 24002b18f0..ebf991ac0a 100644 --- a/org.adempiere.base.process/src/org/compiere/process/FactAcctReset.java +++ b/org.adempiere.base.process/src/org/compiere/process/FactAcctReset.java @@ -158,7 +158,7 @@ public class FactAcctReset extends SvrProcess int invalid = DB.executeUpdate(sql, get_TrxName()); // if (unlocked + invalid != 0) - log.fine(TableName + " - Unlocked=" + unlocked + " - Invalid=" + invalid); + if (log.isLoggable(Level.FINE)) log.fine(TableName + " - Unlocked=" + unlocked + " - Invalid=" + invalid); m_countReset += unlocked + invalid; } // reset diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportAccount.java b/org.adempiere.base.process/src/org/compiere/process/ImportAccount.java index 19a7215010..73f6c8d2be 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportAccount.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportAccount.java @@ -100,7 +100,7 @@ public class ImportAccount extends SvrProcess sql = new StringBuilder ("DELETE I_ElementValue ") .append("WHERE I_IsImported='Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Delete Old Impored =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated @@ -118,7 +118,7 @@ public class ImportAccount extends SvrProcess .append(" I_IsImported = 'N' ") .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Reset=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Reset=" + no); // **** Prepare **** @@ -130,7 +130,7 @@ public class ImportAccount extends SvrProcess .append("WHERE ElementName IS NULL AND C_Element_ID IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Element Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Element Default=" + no); } // sql = new StringBuilder ("UPDATE I_ElementValue i ") @@ -139,7 +139,7 @@ public class ImportAccount extends SvrProcess .append("WHERE C_Element_ID IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Element=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Element=" + no); // sql = new StringBuilder ("UPDATE I_ElementValue ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Element, ' ") @@ -165,7 +165,7 @@ public class ImportAccount extends SvrProcess .append("WHERE Default_Account IS NOT NULL AND AD_Column_ID IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Column=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Column=" + no); // sql = new StringBuilder ("UPDATE I_ElementValue ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Column, ' ") @@ -186,7 +186,7 @@ public class ImportAccount extends SvrProcess .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); StringBuilder msglog = new StringBuilder("Set ").append(yColumns[i]).append(" Default=").append(no); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); } // Summary sql = new StringBuilder ("UPDATE I_ElementValue ") @@ -194,7 +194,7 @@ public class ImportAccount extends SvrProcess .append("WHERE IsSummary IS NULL OR IsSummary NOT IN ('Y','N')") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set IsSummary Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set IsSummary Default=" + no); // Doc Controlled sql = new StringBuilder ("UPDATE I_ElementValue ") @@ -202,7 +202,7 @@ public class ImportAccount extends SvrProcess .append("WHERE IsDocControlled IS NULL OR IsDocControlled NOT IN ('Y','N')") .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set IsDocumentControlled Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set IsDocumentControlled Default=" + no); // Check Account Type A (E) L M O R sql = new StringBuilder ("UPDATE I_ElementValue ") @@ -210,7 +210,7 @@ public class ImportAccount extends SvrProcess .append("WHERE AccountType IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set AccountType Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set AccountType Default=" + no); // sql = new StringBuilder ("UPDATE I_ElementValue ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AccountType, ' ") @@ -225,7 +225,7 @@ public class ImportAccount extends SvrProcess .append("WHERE AccountSign IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set AccountSign Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set AccountSign Default=" + no); // sql = new StringBuilder ("UPDATE I_ElementValue ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AccountSign, ' ") @@ -251,7 +251,7 @@ public class ImportAccount extends SvrProcess .append("WHERE C_ElementValue_ID IS NULL") .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Found ElementValue=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Found ElementValue=" + no); commitEx(); @@ -349,7 +349,7 @@ public class ImportAccount extends SvrProcess .append("WHERE ParentElementValue_ID IS NULL") .append(" AND I_IsImported='Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Found Parent ElementValue=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Found Parent ElementValue=" + no); // sql = new StringBuilder ("UPDATE I_ElementValue ") .append("SET I_ErrorMsg=I_ErrorMsg||'Info=ParentNotFound, ' ") @@ -421,7 +421,7 @@ public class ImportAccount extends SvrProcess if (m_updateDefaultAccounts) sql.append(" AND AD_Column_ID IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Reset Processing Flag=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Reset Processing Flag=" + no); if (m_updateDefaultAccounts) updateDefaults(clientCheck.toString()); @@ -437,7 +437,7 @@ public class ImportAccount extends SvrProcess .append("WHERE I_IsImported='Y'") .append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Processed=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Processed=" + no); return ""; } // doIt @@ -577,7 +577,7 @@ public class ImportAccount extends SvrProcess private int updateDefaultAccount (String TableName, String ColumnName, int C_AcctSchema_ID, int C_ElementValue_ID) { StringBuilder msglog = new StringBuilder(TableName).append(".").append(ColumnName).append(" - ").append(C_ElementValue_ID); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); int retValue = UPDATE_ERROR; StringBuilder sql = new StringBuilder ("SELECT x.") .append(ColumnName).append(",Account_ID FROM ") @@ -620,7 +620,7 @@ public class ImportAccount extends SvrProcess msglog = new StringBuilder("New #").append(no).append(" - ") .append(TableName).append(".").append(ColumnName).append(" - ").append(C_ElementValue_ID) .append(" -- ").append(C_ValidCombination_ID).append(" -> ").append(newC_ValidCombination_ID); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); if (no == 1) retValue = UPDATE_YES; } @@ -636,7 +636,7 @@ public class ImportAccount extends SvrProcess int no = DB.executeUpdate(sql.toString(), get_TrxName()); msglog = new StringBuilder("Replace #").append(no).append(" - ") .append("C_ValidCombination_ID=").append(C_ValidCombination_ID).append(", New Account_ID=").append(C_ElementValue_ID); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); if (no == 1) { retValue = UPDATE_YES; @@ -646,13 +646,13 @@ public class ImportAccount extends SvrProcess no = DB.executeUpdate(sql.toString(), get_TrxName()); msglog = new StringBuilder("ImportAccount.updateDefaultAccount - Replace VC #").append(no).append(" - ") .append("Account_ID=").append(Account_ID).append(", New Account_ID=").append(C_ElementValue_ID); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); sql = new StringBuilder ("UPDATE Fact_Acct SET Account_ID=") .append(C_ElementValue_ID).append(" WHERE Account_ID=").append(Account_ID); no = DB.executeUpdate(sql.toString(), get_TrxName()); msglog = new StringBuilder("ImportAccount.updateDefaultAccount - Replace Fact #").append(no).append(" - ") .append("Account_ID=").append(Account_ID).append(", New Account_ID=").append(C_ElementValue_ID); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); } } // replace combination } // need to update diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java b/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java index 3772fe8a39..792a1e0292 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportBPartner.java @@ -103,7 +103,7 @@ implements ImportProcess sql = new StringBuilder ("DELETE I_BPartner ") .append("WHERE I_IsImported='Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Delete Old Impored =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated @@ -119,7 +119,7 @@ implements ImportProcess .append(" I_IsImported = 'N' ") .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Reset=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Reset=" + no); ModelValidationEngine.get().fireImportValidate(this, null, null, ImportValidator.TIMING_BEFORE_VALIDATE); @@ -130,7 +130,7 @@ implements ImportProcess sql.append("WHERE GroupValue IS NULL AND C_BP_Group_ID IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Set Group Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Group Default=" + no); // sql = new StringBuilder ("UPDATE I_BPartner i ") .append("SET C_BP_Group_ID=(SELECT C_BP_Group_ID FROM C_BP_Group g") @@ -138,7 +138,7 @@ implements ImportProcess .append("WHERE C_BP_Group_ID IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Set Group=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Group=" + no); // sql = new StringBuilder ("UPDATE I_BPartner ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Group, ' ") @@ -164,7 +164,7 @@ implements ImportProcess .append("WHERE C_Country_ID IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Set Country=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Country=" + no); // sql = new StringBuilder ("UPDATE I_BPartner ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' ") @@ -181,7 +181,7 @@ implements ImportProcess sql.append("WHERE RegionName IS NULL AND C_Region_ID IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Set Region Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Region Default=" + no); // sql = new StringBuilder ("UPDATE I_BPartner i ") .append("Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r") @@ -190,7 +190,7 @@ implements ImportProcess .append("WHERE C_Region_ID IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Set Region=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Region=" + no); // sql = new StringBuilder ("UPDATE I_BPartner i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' ") @@ -208,7 +208,7 @@ implements ImportProcess .append("WHERE C_Greeting_ID IS NULL AND BPContactGreeting IS NOT NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Set Greeting=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Greeting=" + no); // sql = new StringBuilder ("UPDATE I_BPartner i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Greeting, ' ") @@ -224,7 +224,7 @@ implements ImportProcess .append("WHERE i.EMail=u.EMail AND u.AD_Client_ID=i.AD_Client_ID) ") .append("WHERE i.EMail IS NOT NULL AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Found EMail User=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Found EMail User=" + no); // Existing BPartner ? Match Value sql = new StringBuilder ("UPDATE I_BPartner i ") @@ -233,7 +233,7 @@ implements ImportProcess .append("WHERE C_BPartner_ID IS NULL AND Value IS NOT NULL") .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Found BPartner=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Found BPartner=" + no); // Existing Contact ? Match Name sql = new StringBuilder ("UPDATE I_BPartner i ") @@ -242,7 +242,7 @@ implements ImportProcess .append("WHERE C_BPartner_ID IS NOT NULL AND AD_User_ID IS NULL AND ContactName IS NOT NULL") .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Found Contact=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Found Contact=" + no); // Existing Location ? Exact Match sql = new StringBuilder ("UPDATE I_BPartner i ") @@ -259,7 +259,7 @@ implements ImportProcess .append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL") .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Found Location=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Found Location=" + no); // Interest Area sql = new StringBuilder ("UPDATE I_BPartner i ") @@ -268,7 +268,7 @@ implements ImportProcess .append("WHERE R_InterestArea_ID IS NULL AND InterestAreaName IS NOT NULL") .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Set Interest Area=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Interest Area=" + no); // Value is mandatory error sql = new StringBuilder ("UPDATE I_BPartner ") @@ -318,7 +318,7 @@ implements ImportProcess .append(", C_BPartner_ID=").append(impBP.getC_BPartner_ID()) .append(", C_BPartner_Location_ID=").append(impBP.getC_BPartner_Location_ID()) .append(", AD_User_ID=").append(impBP.getAD_User_ID()); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); if ( ! New_BPValue.equals(Old_BPValue)) { diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java b/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java index 5448c8e440..f1cb138af7 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java @@ -96,7 +96,7 @@ public class ImportBankStatement extends SvrProcess sql = new StringBuilder ("DELETE I_BankStatement ") .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Delete Old Impored =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java b/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java index b2a067c77a..743d5145f2 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportConversionRate.java @@ -102,7 +102,7 @@ public class ImportConversionRate extends SvrProcess sql = new StringBuilder ("DELETE I_Conversion_Rate ") .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Delete Old Impored =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Impored =" + no); } // Set Client, Org, Location, IsActive, Created/Updated @@ -146,7 +146,7 @@ public class ImportConversionRate extends SvrProcess .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) - log.fine("Set ConversionType =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set ConversionType =" + no); sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ConversionType, ' ") .append("WHERE (C_ConversionType_ID IS NULL") @@ -166,7 +166,7 @@ public class ImportConversionRate extends SvrProcess .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) - log.fine("Set Currency =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Currency =" + no); sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency, ' ") .append("WHERE (C_Currency_ID IS NULL") @@ -186,7 +186,7 @@ public class ImportConversionRate extends SvrProcess .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) - log.fine("Set Currency To =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Currency To =" + no); sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency To, ' ") .append("WHERE (C_Currency_ID_To IS NULL") @@ -205,14 +205,14 @@ public class ImportConversionRate extends SvrProcess .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) - log.fine("Set MultiplyRate =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set MultiplyRate =" + no); sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") .append("SET DivideRate = 1 / MultiplyRate ") .append("WHERE (DivideRate IS NULL OR DivideRate = 0) AND MultiplyRate IS NOT NULL AND MultiplyRate<>0") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no > 0) - log.fine("Set DivideRate =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set DivideRate =" + no); sql = new StringBuilder ("UPDATE I_Conversion_Rate i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Rates, ' ") .append("WHERE (MultiplyRate IS NULL OR MultiplyRate = 0 OR DivideRate IS NULL OR DivideRate = 0)") diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java b/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java index 15ef431761..c568252a52 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportGLJournal.java @@ -109,7 +109,7 @@ public class ImportGLJournal extends SvrProcess sql = new StringBuilder ("DELETE I_GLJournal ") .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Delete Old Impored =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Impored =" + no); } // Set IsActive, Created/Updated @@ -131,7 +131,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE (AD_Client_ID IS NULL OR AD_Client_ID=0) AND ClientValue IS NOT NULL") .append(" AND I_IsImported<>'Y'"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Client from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Client from Value=" + no); // Set Default Client, Doc Org, AcctSchema, DatAcct sql = new StringBuilder ("UPDATE I_GLJournal ") @@ -144,7 +144,7 @@ public class ImportGLJournal extends SvrProcess sql.append(" Updated = COALESCE (Updated, SysDate) ") .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Client/DocOrg/Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Client/DocOrg/Default=" + no); // Error Doc Org sql = new StringBuilder ("UPDATE I_GLJournal o ") @@ -163,13 +163,13 @@ public class ImportGLJournal extends SvrProcess .append("WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set AcctSchema from Name=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set AcctSchema from Name=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET C_AcctSchema_ID=(SELECT c.C_AcctSchema1_ID FROM AD_ClientInfo c WHERE c.AD_Client_ID=i.AD_Client_ID) ") .append("WHERE C_AcctSchema_ID IS NULL AND AcctSchemaName IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set AcctSchema from Client=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set AcctSchema from Client=" + no); // Error AcctSchema sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid AcctSchema, '") @@ -186,7 +186,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE DateAcct IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set DateAcct=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set DateAcct=" + no); // Document Type sql = new StringBuilder ("UPDATE I_GLJournal i ") @@ -195,7 +195,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set DocType=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocType, '") .append("WHERE (C_DocType_ID IS NULL OR C_DocType_ID=0") @@ -212,7 +212,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE GL_Category_ID IS NULL AND CategoryName IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set DocType=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Category, '") .append("WHERE (GL_Category_ID IS NULL OR GL_Category_ID=0)") @@ -228,14 +228,14 @@ public class ImportGLJournal extends SvrProcess .append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Currency from ISO=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Currency from ISO=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET C_Currency_ID=(SELECT a.C_Currency_ID FROM C_AcctSchema a") .append(" WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.AD_Client_ID=i.AD_Client_ID)") .append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Default Currency=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Default Currency=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Currency, '") .append("WHERE (C_Currency_ID IS NULL OR C_Currency_ID=0)") @@ -250,14 +250,14 @@ public class ImportGLJournal extends SvrProcess .append("WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NULL") .append(" AND I_IsImported='N'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set CurrencyType Value to Spot =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set CurrencyType Value to Spot =" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET C_ConversionType_ID=(SELECT c.C_ConversionType_ID FROM C_ConversionType c") .append(" WHERE c.Value=i.ConversionTypeValue AND c.AD_Client_ID IN (0,i.AD_Client_ID)) ") .append("WHERE C_ConversionType_ID IS NULL AND ConversionTypeValue IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set CurrencyType from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set CurrencyType from Value=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid CurrencyType, '") .append("WHERE (C_ConversionType_ID IS NULL OR C_ConversionType_ID=0) AND ConversionTypeValue IS NOT NULL") @@ -282,7 +282,7 @@ public class ImportGLJournal extends SvrProcess .append(" WHERE a.C_AcctSchema_ID=i.C_AcctSchema_ID AND a.C_Currency_ID=i.C_Currency_ID)") .append(" AND C_Currency_ID IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Home CurrencyRate=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Home CurrencyRate=" + no); // Set Currency Rate sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET CurrencyRate=(SELECT MAX(r.MultiplyRate) FROM C_Conversion_Rate r, C_AcctSchema s") @@ -295,7 +295,7 @@ public class ImportGLJournal extends SvrProcess .append(") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Org Rate=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Org Rate=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET CurrencyRate=(SELECT MAX(r.MultiplyRate) FROM C_Conversion_Rate r, C_AcctSchema s") .append(" WHERE s.C_AcctSchema_ID=i.C_AcctSchema_ID AND s.AD_Client_ID=i.AD_Client_ID") @@ -307,7 +307,7 @@ public class ImportGLJournal extends SvrProcess .append(") WHERE CurrencyRate IS NULL OR CurrencyRate=0 AND C_Currency_ID>0") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Client Rate=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Client Rate=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Rate, '") .append("WHERE CurrencyRate IS NULL OR CurrencyRate=0") @@ -327,7 +327,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE C_Period_ID IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Period=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Period=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Period, '") .append("WHERE C_Period_ID IS NULL OR C_Period_ID NOT IN") @@ -355,7 +355,7 @@ public class ImportGLJournal extends SvrProcess .append("SET PostingType='A' ") .append("WHERE PostingType IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Actual PostingType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Actual PostingType=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid PostingType, ' ") .append("WHERE PostingType IS NULL OR NOT EXISTS") @@ -376,13 +376,13 @@ public class ImportGLJournal extends SvrProcess .append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NOT NULL") .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Org from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Org from Value=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET AD_Org_ID=AD_OrgDoc_ID ") .append("WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0) AND OrgValue IS NULL AND AD_OrgDoc_ID IS NOT NULL AND AD_OrgDoc_ID<>0") .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Org from Doc Org=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Org from Doc Org=" + no); // Error Org sql = new StringBuilder ("UPDATE I_GLJournal o ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '") @@ -403,7 +403,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE Account_ID IS NULL AND AccountValue IS NOT NULL") .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Account from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Account from Value=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Account, '") .append("WHERE (Account_ID IS NULL OR Account_ID=0)") @@ -419,7 +419,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL") .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set BPartner from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BPartner from Value=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid BPartner, '") .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL") @@ -436,7 +436,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)") .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Product from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Product from Value=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, '") .append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)") @@ -452,7 +452,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL") .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Project from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Project from Value=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Project, '") .append("WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL") @@ -469,7 +469,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE C_Campaign_ID IS NULL AND CampaignValue IS NOT NULL") .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Campaign from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Campaign from Value=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Campaign, '") .append("WHERE C_Campaign_ID IS NULL AND CampaignValue IS NOT NULL") @@ -485,7 +485,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE C_Activity_ID IS NULL AND ActivityValue IS NOT NULL") .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Activity from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Activity from Value=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Activity, '") .append("WHERE C_Activity_ID IS NULL AND ActivityValue IS NOT NULL") @@ -501,7 +501,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE C_SalesRegion_ID IS NULL AND SalesRegionValue IS NOT NULL") .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set SalesRegion from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set SalesRegion from Value=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid SalesRegion, '") .append("WHERE C_SalesRegion_ID IS NULL AND SalesRegionValue IS NOT NULL") @@ -518,7 +518,7 @@ public class ImportGLJournal extends SvrProcess .append("WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL") .append(" AND (C_ValidCombination_ID IS NULL OR C_ValidCombination_ID=0) AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set OrgTrx from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set OrgTrx from Value=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid OrgTrx, '") .append("WHERE AD_OrgTrx_ID IS NULL AND OrgTrxValue IS NOT NULL") @@ -534,13 +534,13 @@ public class ImportGLJournal extends SvrProcess .append("WHERE AmtSourceDr IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set 0 Source Dr=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set 0 Source Dr=" + no); sql = new StringBuilder ("UPDATE I_GLJournal ") .append("SET AmtSourceCr = 0 ") .append("WHERE AmtSourceCr IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set 0 Source Cr=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set 0 Source Cr=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Source Balance, ' ") .append("WHERE (AmtSourceDr-AmtSourceCr)=0") @@ -555,13 +555,13 @@ public class ImportGLJournal extends SvrProcess .append("WHERE AmtAcctDr IS NULL OR AmtAcctDr=0") .append(" AND I_IsImported='N'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Calculate Acct Dr=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Calculate Acct Dr=" + no); sql = new StringBuilder ("UPDATE I_GLJournal ") .append("SET AmtAcctCr = ROUND(AmtSourceCr * CurrencyRate, 2) ") .append("WHERE AmtAcctCr IS NULL OR AmtAcctCr=0") .append(" AND I_IsImported='N'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Calculate Acct Cr=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Calculate Acct Cr=" + no); sql = new StringBuilder ("UPDATE I_GLJournal i ") .append("SET I_ErrorMsg=I_ErrorMsg||'WARN=Zero Acct Balance, ' ") .append("WHERE (AmtSourceDr-AmtSourceCr)<>0 AND (AmtAcctDr-AmtAcctCr)=0") diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportInOutConfirm.java b/org.adempiere.base.process/src/org/compiere/process/ImportInOutConfirm.java index dbce76bcf3..ea9850e01d 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportInOutConfirm.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportInOutConfirm.java @@ -80,7 +80,7 @@ public class ImportInOutConfirm extends SvrProcess sql = new StringBuilder ("DELETE I_InOutLineConfirm ") .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Delete Old Impored =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Impored =" + no); } // Set IsActive, Created/Updated @@ -102,7 +102,7 @@ public class ImportInOutConfirm extends SvrProcess .append("WHERE (AD_Client_ID IS NULL OR AD_Client_ID=0)") .append(" AND I_IsImported<>'Y'"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Client from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Client from Value=" + no); // Error Confirmation Line sql = new StringBuilder ("UPDATE I_InOutLineConfirm i ") diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java b/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java index 31ac613127..5c85243c54 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportInventory.java @@ -149,7 +149,7 @@ public class ImportInventory extends SvrProcess sql = new StringBuilder ("DELETE I_Inventory ") .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); - log.fine("Delete Old Imported=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Imported=" + no); } // Set Client, Org, Location, IsActive, Created/Updated @@ -186,7 +186,7 @@ public class ImportInventory extends SvrProcess .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set DocType=" + no); sql = new StringBuilder ("UPDATE I_Inventory i ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocType, ' ") .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") @@ -202,14 +202,14 @@ public class ImportInventory extends SvrProcess .append("WHERE M_Locator_ID IS NULL AND LocatorValue IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); - log.fine("Set Locator from Value =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Locator from Value =" + no); sql = new StringBuilder ("UPDATE I_Inventory i ") .append("SET M_Locator_ID=(SELECT MAX(M_Locator_ID) FROM M_Locator l") .append(" WHERE i.X=l.X AND i.Y=l.Y AND i.Z=l.Z AND i.AD_Client_ID=l.AD_Client_ID) ") .append("WHERE M_Locator_ID IS NULL AND X IS NOT NULL AND Y IS NOT NULL AND Z IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); - log.fine("Set Locator from X,Y,Z =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Locator from X,Y,Z =" + no); if (p_M_Locator_ID != 0) { sql = new StringBuilder ("UPDATE I_Inventory ") @@ -217,7 +217,7 @@ public class ImportInventory extends SvrProcess .append (" WHERE M_Locator_ID IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); - log.fine("Set Locator from Parameter=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Locator from Parameter=" + no); } sql = new StringBuilder ("UPDATE I_Inventory ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Location, ' ") @@ -233,7 +233,7 @@ public class ImportInventory extends SvrProcess .append("WHERE M_Locator_ID IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); - log.fine("Set Warehouse from Locator =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Warehouse from Locator =" + no); sql = new StringBuilder ("UPDATE I_Inventory ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Warehouse, ' ") .append("WHERE M_Warehouse_ID IS NULL") @@ -258,14 +258,14 @@ public class ImportInventory extends SvrProcess .append("WHERE M_Product_ID IS NULL AND Value IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); - log.fine("Set Product from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Product from Value=" + no); sql = new StringBuilder ("UPDATE I_Inventory i ") .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") .append(" WHERE i.UPC=p.UPC AND i.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_Product_ID IS NULL AND UPC IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString (), get_TrxName()); - log.fine("Set Product from UPC=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Product from UPC=" + no); sql = new StringBuilder ("UPDATE I_Inventory ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Product, ' ") .append("WHERE M_Product_ID IS NULL") @@ -280,7 +280,7 @@ public class ImportInventory extends SvrProcess .append(" WHERE o.ChargeName=p.Name AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Charge=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Charge=" + no); sql = new StringBuilder ("UPDATE I_Inventory ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' ") .append("WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)") diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java b/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java index f9547e721a..5f38d284e9 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportInvoice.java @@ -98,7 +98,7 @@ public class ImportInvoice extends SvrProcess sql = new StringBuilder ("DELETE I_Invoice ") .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Delete Old Impored =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated @@ -132,14 +132,14 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set PO DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set PO DocType=" + no); sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName") .append(" AND d.DocBaseType IN ('ARI','ARC') AND o.AD_Client_ID=d.AD_Client_ID) ") .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set SO DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set SO DocType=" + no); sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName") .append(" AND d.DocBaseType IN ('API','ARI','APC','ARC') AND o.AD_Client_ID=d.AD_Client_ID) ") @@ -147,7 +147,7 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set DocType=" + no); sql = new StringBuilder ("UPDATE I_Invoice ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' ") .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") @@ -162,21 +162,21 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set PO Default DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set PO Default DocType=" + no); sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'") .append(" AND d.DocBaseType='ARI' AND o.AD_Client_ID=d.AD_Client_ID) ") .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set SO Default DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set SO Default DocType=" + no); sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'") .append(" AND d.DocBaseType IN('ARI','API') AND o.AD_Client_ID=d.AD_Client_ID) ") .append("WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set Default DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Default DocType=" + no); sql = new StringBuilder ("UPDATE I_Invoice ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' ") .append("WHERE C_DocType_ID IS NULL") @@ -191,13 +191,13 @@ public class ImportInvoice extends SvrProcess .append(" AND C_DocType_ID IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set IsSOTrx=Y=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set IsSOTrx=Y=" + no); sql = new StringBuilder ("UPDATE I_Invoice o SET IsSOTrx='N' ") .append("WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='API' AND o.AD_Client_ID=d.AD_Client_ID)") .append(" AND C_DocType_ID IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set IsSOTrx=N=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set IsSOTrx=N=" + no); // Price List sql = new StringBuilder ("UPDATE I_Invoice o ") @@ -205,25 +205,25 @@ public class ImportInvoice extends SvrProcess .append(" AND p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Default Currency PriceList=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Default Currency PriceList=" + no); sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'") .append(" AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Default PriceList=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Default PriceList=" + no); sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ") .append(" WHERE p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Currency PriceList=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Currency PriceList=" + no); sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ") .append(" WHERE p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set PriceList=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set PriceList=" + no); // sql = new StringBuilder ("UPDATE I_Invoice ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PriceList, ' ") @@ -239,13 +239,13 @@ public class ImportInvoice extends SvrProcess .append(" WHERE o.PaymentTermValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE C_PaymentTerm_ID IS NULL AND PaymentTermValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set PaymentTerm=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set PaymentTerm=" + no); sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET C_PaymentTerm_ID=(SELECT MAX(C_PaymentTerm_ID) FROM C_PaymentTerm p") .append(" WHERE p.IsDefault='Y' AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE C_PaymentTerm_ID IS NULL AND o.PaymentTermValue IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Default PaymentTerm=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Default PaymentTerm=" + no); // sql = new StringBuilder ("UPDATE I_Invoice ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PaymentTerm, ' ") @@ -262,7 +262,7 @@ public class ImportInvoice extends SvrProcess .append(" WHERE o.ProjectValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE C_Project_ID IS NULL AND ProjectValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Project=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Project=" + no); sql = new StringBuilder ("UPDATE I_Invoice ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Project, ' ") .append("WHERE C_Project_ID IS NULL AND (ProjectValue IS NOT NULL)") @@ -276,7 +276,7 @@ public class ImportInvoice extends SvrProcess .append(" WHERE o.ActivityValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE C_Activity_ID IS NULL AND ActivityValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Activity=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Activity=" + no); sql = new StringBuilder ("UPDATE I_Invoice ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Activity, ' ") .append("WHERE C_Activity_ID IS NULL AND (ActivityValue IS NOT NULL)") @@ -291,7 +291,7 @@ public class ImportInvoice extends SvrProcess .append(" WHERE o.ChargeName=p.Name AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Charge=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Charge=" + no); sql = new StringBuilder ("UPDATE I_Invoice ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' ") .append("WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)") @@ -308,7 +308,7 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND EMail IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set BP from EMail=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP from EMail=" + no); // BP from ContactName sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u") @@ -317,7 +317,7 @@ public class ImportInvoice extends SvrProcess .append(" AND EXISTS (SELECT Name FROM AD_User u WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL GROUP BY Name HAVING COUNT(*)=1)") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set BP from ContactName=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP from ContactName=" + no); // BP from Value sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp") @@ -325,7 +325,7 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set BP from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP from Value=" + no); // Default BP sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo c") @@ -333,7 +333,7 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NULL AND Name IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Default BP=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Default BP=" + no); // Existing Location ? Exact Match sql = new StringBuilder ("UPDATE I_Invoice o ") @@ -346,7 +346,7 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL") .append(" AND I_IsImported='N'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Found Location=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Found Location=" + no); // Set Location from BPartner sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET C_BPartner_Location_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l") @@ -356,7 +356,7 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set BP Location from BP=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP Location from BP=" + no); // sql = new StringBuilder ("UPDATE I_Invoice ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BP Location, ' ") @@ -382,7 +382,7 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL AND CountryCode IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Country=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Country=" + no); // sql = new StringBuilder ("UPDATE I_Invoice ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' ") @@ -400,7 +400,7 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Region Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Region Default=" + no); // sql = new StringBuilder ("UPDATE I_Invoice o ") .append("Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r") @@ -409,7 +409,7 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Region=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Region=" + no); // sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' ") @@ -428,21 +428,21 @@ public class ImportInvoice extends SvrProcess .append("WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Product from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Product from Value=" + no); sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") .append(" WHERE o.UPC=p.UPC AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_Product_ID IS NULL AND UPC IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Product from UPC=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Product from UPC=" + no); sql = new StringBuilder ("UPDATE I_Invoice o ") .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") .append(" WHERE o.SKU=p.SKU AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_Product_ID IS NULL AND SKU IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Product fom SKU=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Product fom SKU=" + no); sql = new StringBuilder ("UPDATE I_Invoice ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' ") .append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)") @@ -467,7 +467,7 @@ public class ImportInvoice extends SvrProcess .append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Tax=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Tax=" + no); sql = new StringBuilder ("UPDATE I_Invoice ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Tax, ' ") .append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL") diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java b/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java index 25ae8d22bb..93de2663e6 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportOrder.java @@ -100,7 +100,7 @@ public class ImportOrder extends SvrProcess sql = new StringBuilder ("DELETE I_Order ") .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Delete Old Impored =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated @@ -133,20 +133,20 @@ public class ImportOrder extends SvrProcess .append(" AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID) ") .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set PO DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set PO DocType=" + no); sql = new StringBuilder ("UPDATE I_Order o ") // SO Document Type Name .append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName") .append(" AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID) ") .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set SO DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set SO DocType=" + no); sql = new StringBuilder ("UPDATE I_Order o ") .append("SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName") .append(" AND d.DocBaseType IN ('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) ") //+ "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set DocType=" + no); sql = new StringBuilder ("UPDATE I_Order ") // Error Invalid Doc Type Name .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' ") .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") @@ -160,19 +160,19 @@ public class ImportOrder extends SvrProcess .append(" AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID) ") .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='N' AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set PO Default DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set PO Default DocType=" + no); sql = new StringBuilder ("UPDATE I_Order o ") // Default SO .append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'") .append(" AND d.DocBaseType='SOO' AND o.AD_Client_ID=d.AD_Client_ID) ") .append("WHERE C_DocType_ID IS NULL AND IsSOTrx='Y' AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set SO Default DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set SO Default DocType=" + no); sql = new StringBuilder ("UPDATE I_Order o ") .append("SET C_DocType_ID=(SELECT MAX(C_DocType_ID) FROM C_DocType d WHERE d.IsDefault='Y'") .append(" AND d.DocBaseType IN('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) ") .append("WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Default DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Default DocType=" + no); sql = new StringBuilder ("UPDATE I_Order ") // No DocType .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No DocType, ' ") .append("WHERE C_DocType_ID IS NULL") @@ -187,13 +187,13 @@ public class ImportOrder extends SvrProcess .append(" AND C_DocType_ID IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set IsSOTrx=Y=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set IsSOTrx=Y=" + no); sql = new StringBuilder ("UPDATE I_Order o SET IsSOTrx='N' ") .append("WHERE EXISTS (SELECT * FROM C_DocType d WHERE o.C_DocType_ID=d.C_DocType_ID AND d.DocBaseType='POO' AND o.AD_Client_ID=d.AD_Client_ID)") .append(" AND C_DocType_ID IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set IsSOTrx=N=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set IsSOTrx=N=" + no); // Price List sql = new StringBuilder ("UPDATE I_Order o ") @@ -201,25 +201,25 @@ public class ImportOrder extends SvrProcess .append(" AND p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Default Currency PriceList=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Default Currency PriceList=" + no); sql = new StringBuilder ("UPDATE I_Order o ") .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p WHERE p.IsDefault='Y'") .append(" AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Default PriceList=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Default PriceList=" + no); sql = new StringBuilder ("UPDATE I_Order o ") .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ") .append(" WHERE p.C_Currency_ID=o.C_Currency_ID AND p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_PriceList_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Currency PriceList=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Currency PriceList=" + no); sql = new StringBuilder ("UPDATE I_Order o ") .append("SET M_PriceList_ID=(SELECT MAX(M_PriceList_ID) FROM M_PriceList p ") .append(" WHERE p.IsSOPriceList=o.IsSOTrx AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_PriceList_ID IS NULL AND C_Currency_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set PriceList=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set PriceList=" + no); // sql = new StringBuilder ("UPDATE I_Order ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PriceList, ' ") @@ -235,7 +235,7 @@ public class ImportOrder extends SvrProcess .append(" WHERE o.C_OrderSourceValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE C_OrderSource_ID IS NULL AND C_OrderSourceValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Order Source=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Order Source=" + no); // Set proper error message sql = new StringBuilder ("UPDATE I_Order ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Not Found Order Source, ' ") @@ -250,13 +250,13 @@ public class ImportOrder extends SvrProcess .append(" WHERE o.PaymentTermValue=p.Value AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE C_PaymentTerm_ID IS NULL AND PaymentTermValue IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set PaymentTerm=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set PaymentTerm=" + no); sql = new StringBuilder ("UPDATE I_Order o ") .append("SET C_PaymentTerm_ID=(SELECT MAX(C_PaymentTerm_ID) FROM C_PaymentTerm p") .append(" WHERE p.IsDefault='Y' AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE C_PaymentTerm_ID IS NULL AND o.PaymentTermValue IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Default PaymentTerm=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Default PaymentTerm=" + no); // sql = new StringBuilder ("UPDATE I_Order ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No PaymentTerm, ' ") @@ -273,7 +273,7 @@ public class ImportOrder extends SvrProcess .append("WHERE M_Warehouse_ID IS NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); // Warehouse for Org if (no != 0) - log.fine("Set Warehouse=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Warehouse=" + no); sql = new StringBuilder ("UPDATE I_Order o ") .append("SET M_Warehouse_ID=(SELECT M_Warehouse_ID FROM M_Warehouse w") .append(" WHERE o.AD_Client_ID=w.AD_Client_ID) ") @@ -282,7 +282,7 @@ public class ImportOrder extends SvrProcess .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set Only Client Warehouse=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Only Client Warehouse=" + no); // sql = new StringBuilder ("UPDATE I_Order ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Warehouse, ' ") @@ -299,7 +299,7 @@ public class ImportOrder extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND EMail IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set BP from EMail=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP from EMail=" + no); // BP from ContactName sql = new StringBuilder ("UPDATE I_Order o ") .append("SET (C_BPartner_ID,AD_User_ID)=(SELECT C_BPartner_ID,AD_User_ID FROM AD_User u") @@ -308,7 +308,7 @@ public class ImportOrder extends SvrProcess .append(" AND EXISTS (SELECT Name FROM AD_User u WHERE o.ContactName=u.Name AND o.AD_Client_ID=u.AD_Client_ID AND u.C_BPartner_ID IS NOT NULL GROUP BY Name HAVING COUNT(*)=1)") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set BP from ContactName=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP from ContactName=" + no); // BP from Value sql = new StringBuilder ("UPDATE I_Order o ") .append("SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_BPartner bp") @@ -316,7 +316,7 @@ public class ImportOrder extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set BP from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP from Value=" + no); // Default BP sql = new StringBuilder ("UPDATE I_Order o ") .append("SET C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo c") @@ -324,7 +324,7 @@ public class ImportOrder extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND BPartnerValue IS NULL AND Name IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Default BP=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Default BP=" + no); // Existing Location ? Exact Match sql = new StringBuilder ("UPDATE I_Order o ") @@ -337,7 +337,7 @@ public class ImportOrder extends SvrProcess .append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL") .append(" AND I_IsImported='N'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Found Location=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Found Location=" + no); // Set Bill Location from BPartner sql = new StringBuilder ("UPDATE I_Order o ") .append("SET BillTo_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l") @@ -347,7 +347,7 @@ public class ImportOrder extends SvrProcess .append("WHERE C_BPartner_ID IS NOT NULL AND BillTo_ID IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set BP BillTo from BP=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP BillTo from BP=" + no); // Set Location from BPartner sql = new StringBuilder ("UPDATE I_Order o ") .append("SET C_BPartner_Location_ID=(SELECT MAX(C_BPartner_Location_ID) FROM C_BPartner_Location l") @@ -357,7 +357,7 @@ public class ImportOrder extends SvrProcess .append("WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set BP Location from BP=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP Location from BP=" + no); // sql = new StringBuilder ("UPDATE I_Order ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BP Location, ' ") @@ -383,7 +383,7 @@ public class ImportOrder extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND C_Country_ID IS NULL AND CountryCode IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Country=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Country=" + no); // sql = new StringBuilder ("UPDATE I_Order ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Country, ' ") @@ -401,7 +401,7 @@ public class ImportOrder extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Region Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Region Default=" + no); // sql = new StringBuilder ("UPDATE I_Order o ") .append("Set C_Region_ID=(SELECT C_Region_ID FROM C_Region r") @@ -410,7 +410,7 @@ public class ImportOrder extends SvrProcess .append("WHERE C_BPartner_ID IS NULL AND C_Region_ID IS NULL AND RegionName IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Region=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Region=" + no); // sql = new StringBuilder ("UPDATE I_Order o ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Region, ' ") @@ -429,21 +429,21 @@ public class ImportOrder extends SvrProcess .append("WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Product from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Product from Value=" + no); sql = new StringBuilder ("UPDATE I_Order o ") .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") .append(" WHERE o.UPC=p.UPC AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_Product_ID IS NULL AND UPC IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Product from UPC=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Product from UPC=" + no); sql = new StringBuilder ("UPDATE I_Order o ") .append("SET M_Product_ID=(SELECT MAX(M_Product_ID) FROM M_Product p") .append(" WHERE o.SKU=p.SKU AND o.AD_Client_ID=p.AD_Client_ID) ") .append("WHERE M_Product_ID IS NULL AND SKU IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Product fom SKU=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Product fom SKU=" + no); sql = new StringBuilder ("UPDATE I_Order ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' ") .append("WHERE M_Product_ID IS NULL AND (ProductValue IS NOT NULL OR UPC IS NOT NULL OR SKU IS NOT NULL)") @@ -458,7 +458,7 @@ public class ImportOrder extends SvrProcess .append(" WHERE o.ChargeName=c.Name AND o.AD_Client_ID=c.AD_Client_ID) ") .append("WHERE C_Charge_ID IS NULL AND ChargeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Charge=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Charge=" + no); sql = new StringBuilder ("UPDATE I_Order ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Charge, ' ") .append("WHERE C_Charge_ID IS NULL AND (ChargeName IS NOT NULL)") @@ -483,7 +483,7 @@ public class ImportOrder extends SvrProcess .append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL") .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Tax=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Tax=" + no); sql = new StringBuilder ("UPDATE I_Order ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Tax, ' ") .append("WHERE C_Tax_ID IS NULL AND TaxIndicator IS NOT NULL") diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportPayment.java b/org.adempiere.base.process/src/org/compiere/process/ImportPayment.java index eccf0f60fd..632e476d4e 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportPayment.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportPayment.java @@ -102,7 +102,7 @@ public class ImportPayment extends SvrProcess sql = new StringBuilder ("DELETE I_Payment ") .append("WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Delete Old Impored =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated @@ -272,7 +272,7 @@ public class ImportPayment extends SvrProcess .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set Invoice from DocumentNo=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Invoice from DocumentNo=" + no); // BPartner sql = new StringBuilder ("UPDATE I_Payment i ") @@ -282,7 +282,7 @@ public class ImportPayment extends SvrProcess .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set BP from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP from Value=" + no); sql = new StringBuilder ("UPDATE I_Payment i ") .append("SET C_BPartner_ID=(SELECT MAX(C_BPartner_ID) FROM C_Invoice ii") @@ -291,7 +291,7 @@ public class ImportPayment extends SvrProcess .append(" AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set BP from Invoice=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP from Invoice=" + no); sql = new StringBuilder ("UPDATE I_Payment ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner,' ") @@ -388,7 +388,7 @@ public class ImportPayment extends SvrProcess .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set DocType=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set DocType=" + no); sql = new StringBuilder ("UPDATE I_Payment ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid DocTypeName, ' ") .append("WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL") diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java b/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java index 3a059f09cd..536bb7fed3 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportProduct.java @@ -188,7 +188,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess .append(" AND M_Product_ID IS NULL") // set category only if product not found .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Category Default Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Category Default Value=" + no); // sql = new StringBuilder ("UPDATE I_Product i ") .append("SET M_Product_Category_ID=(SELECT M_Product_Category_ID FROM M_Product_Category c") @@ -210,7 +210,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine(strFieldsToCopy[i] + " - default from existing Product=" + no); + if (log.isLoggable(Level.FINE)) log.fine(strFieldsToCopy[i] + " - default from existing Product=" + no); } String[] numFields = new String[] {"C_UOM_ID","M_Product_Category_ID", "Volume","Weight","ShelfWidth","ShelfHeight","ShelfDepth","UnitsPerPallet"}; @@ -224,7 +224,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine(numFields[i] + " default from existing Product=" + no); + if (log.isLoggable(Level.FINE)) log.fine(numFields[i] + " default from existing Product=" + no); } // Copy From Product_PO if Import does not have value @@ -242,7 +242,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine(strFieldsPO[i] + " default from existing Product PO=" + no); + if (log.isLoggable(Level.FINE)) log.fine(strFieldsPO[i] + " default from existing Product PO=" + no); } String[] numFieldsPO = new String[] {"C_UOM_ID","C_Currency_ID", "PriceList","PricePO","RoyaltyAmt", @@ -258,7 +258,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine(numFieldsPO[i] + " default from existing Product PO=" + no); + if (log.isLoggable(Level.FINE)) log.fine(numFieldsPO[i] + " default from existing Product PO=" + no); } // Invalid Category @@ -278,7 +278,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess .append("WHERE X12DE355 IS NULL AND C_UOM_ID IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set UOM Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set UOM Default=" + no); // sql = new StringBuilder ("UPDATE I_Product i ") .append("SET C_UOM_ID = (SELECT C_UOM_ID FROM C_UOM u WHERE u.X12DE355=i.X12DE355 AND u.AD_Client_ID IN (0,i.AD_Client_ID)) ") @@ -305,7 +305,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess .append("WHERE C_Currency_ID IS NULL AND ISO_Code IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Currency Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Currency Default=" + no); // sql = new StringBuilder ("UPDATE I_Product i ") .append("SET C_Currency_ID=(SELECT C_Currency_ID FROM C_Currency c") @@ -405,7 +405,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess rs = null; pstmt = null; } - log.fine("C_TaxCategory_ID=" + C_TaxCategory_ID); + if (log.isLoggable(Level.FINE)) log.fine("C_TaxCategory_ID=" + C_TaxCategory_ID); ModelValidationEngine.get().fireImportValidate(this, null, null, ImportValidator.TIMING_AFTER_VALIDATE); @@ -509,7 +509,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess int M_Product_ID = imp.getM_Product_ID(); int C_BPartner_ID = imp.getC_BPartner_ID(); boolean newProduct = M_Product_ID == 0; - log.fine("I_Product_ID=" + I_Product_ID + ", M_Product_ID=" + M_Product_ID + if (log.isLoggable(Level.FINE)) log.fine("I_Product_ID=" + I_Product_ID + ", M_Product_ID=" + M_Product_ID + ", C_BPartner_ID=" + C_BPartner_ID); // Product diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportReportLine.java b/org.adempiere.base.process/src/org/compiere/process/ImportReportLine.java index 0bed108d9b..f5a5f2f823 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportReportLine.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportReportLine.java @@ -88,7 +88,7 @@ public class ImportReportLine extends SvrProcess sql = new StringBuilder ("DELETE I_ReportLine ") .append("WHERE I_IsImported='Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Delete Old Impored =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated @@ -104,7 +104,7 @@ public class ImportReportLine extends SvrProcess .append(" I_IsImported = 'N' ") .append("WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Reset=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Reset=" + no); // ReportLineSetName (Default) if (m_PA_ReportLineSet_ID != 0) @@ -115,7 +115,7 @@ public class ImportReportLine extends SvrProcess .append("WHERE ReportLineSetName IS NULL AND PA_ReportLineSet_ID IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set ReportLineSetName Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set ReportLineSetName Default=" + no); } // Set PA_ReportLineSet_ID sql = new StringBuilder ("UPDATE I_ReportLine i ") @@ -124,7 +124,7 @@ public class ImportReportLine extends SvrProcess .append("WHERE PA_ReportLineSet_ID IS NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set PA_ReportLineSet_ID=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set PA_ReportLineSet_ID=" + no); // sql = new StringBuilder ("UPDATE I_ReportLine ") .append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid ReportLineSet, ' ") @@ -148,7 +148,7 @@ public class ImportReportLine extends SvrProcess .append("WHERE C_ElementValue_ID IS NULL AND ElementValue IS NOT NULL") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set C_ElementValue_ID=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set C_ElementValue_ID=" + no); // Validate C_ElementValue_ID sql = new StringBuilder ("UPDATE I_ReportLine ") @@ -164,7 +164,7 @@ public class ImportReportLine extends SvrProcess .append("WHERE SeqNo IS NULL") .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set SeqNo Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set SeqNo Default=" + no); // Copy/Sync from first Row of Line sql = new StringBuilder ("UPDATE I_ReportLine i ") @@ -179,7 +179,7 @@ public class ImportReportLine extends SvrProcess .append(" WHERE i.Name=iii.Name AND i.PA_ReportLineSet_ID=iii.PA_ReportLineSet_ID))") .append(" AND I_IsImported='N'").append(clientCheck); // not if previous error no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Sync from first Row of Line=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Sync from first Row of Line=" + no); // Validate IsSummary - (N) Y sql = new StringBuilder ("UPDATE I_ReportLine ") @@ -187,7 +187,7 @@ public class ImportReportLine extends SvrProcess .append("WHERE IsSummary IS NULL OR IsSummary NOT IN ('Y','N')") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set IsSummary Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set IsSummary Default=" + no); // Validate IsPrinted - (Y) N sql = new StringBuilder ("UPDATE I_ReportLine ") @@ -195,7 +195,7 @@ public class ImportReportLine extends SvrProcess .append("WHERE IsPrinted IS NULL OR IsPrinted NOT IN ('Y','N')") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set IsPrinted Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set IsPrinted Default=" + no); // Validate Line Type - (S) C sql = new StringBuilder ("UPDATE I_ReportLine ") @@ -203,7 +203,7 @@ public class ImportReportLine extends SvrProcess .append("WHERE LineType IS NULL OR LineType NOT IN ('S','C')") .append(" AND I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set LineType Default=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set LineType Default=" + no); // Validate Optional Calculation Type - A P R S sql = new StringBuilder ("UPDATE I_ReportLine ") @@ -252,7 +252,7 @@ public class ImportReportLine extends SvrProcess .append("WHERE PA_ReportLine_ID IS NULL AND PA_ReportLineSet_ID IS NOT NULL") .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set PA_ReportLine_ID=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set PA_ReportLine_ID=" + no); commitEx(); @@ -334,7 +334,7 @@ public class ImportReportLine extends SvrProcess .append("WHERE PA_ReportLine_ID IS NULL AND PA_ReportLineSet_ID IS NOT NULL") .append(" AND I_IsImported='N'").append(clientCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set PA_ReportLine_ID=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set PA_ReportLine_ID=" + no); // **** Update ReportLine sql = new StringBuilder ("UPDATE PA_ReportLine r ") diff --git a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java index 6d9aefc6fc..16ccebf1c6 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java @@ -224,7 +224,7 @@ public class InOutGenerate extends SvrProcess && (m_shipment.getC_BPartner_Location_ID() != order.getC_BPartner_Location_ID() || m_shipment.getM_Shipper_ID() != order.getM_Shipper_ID() ))) completeShipment(); - log.fine("check: " + order + " - DeliveryRule=" + order.getDeliveryRule()); + if (log.isLoggable(Level.FINE)) log.fine("check: " + order + " - DeliveryRule=" + order.getDeliveryRule()); // Timestamp minGuaranteeDate = m_movementDate; boolean completeOrder = MOrder.DELIVERYRULE_CompleteOrder.equals(order.getDeliveryRule()); @@ -251,7 +251,7 @@ public class InOutGenerate extends SvrProcess MOrderLine line = lines[i]; if (line.getM_Warehouse_ID() != p_M_Warehouse_ID) continue; - log.fine("check: " + line); + if (log.isLoggable(Level.FINE)) log.fine("check: " + line); BigDecimal onHand = Env.ZERO; BigDecimal toDeliver = line.getQtyOrdered() .subtract(line.getQtyDelivered()); @@ -284,7 +284,7 @@ public class InOutGenerate extends SvrProcess } // Adjust On Hand onHand = onHand.subtract(unconfirmedShippedQty); - log.fine(logInfo.toString()); + if (log.isLoggable(Level.FINE)) log.fine(logInfo.toString()); } // Comments & lines w/o product & services @@ -315,7 +315,7 @@ public class InOutGenerate extends SvrProcess // Complete Order if (completeOrder && !fullLine) { - log.fine("Failed CompleteOrder - OnHand=" + onHand + if (log.isLoggable(Level.FINE)) log.fine("Failed CompleteOrder - OnHand=" + onHand + " (Unconfirmed=" + unconfirmedShippedQty + "), ToDeliver=" + toDeliver + " - " + line); completeOrder = false; @@ -324,7 +324,7 @@ public class InOutGenerate extends SvrProcess // Complete Line else if (fullLine && MOrder.DELIVERYRULE_CompleteLine.equals(order.getDeliveryRule())) { - log.fine("CompleteLine - OnHand=" + onHand + if (log.isLoggable(Level.FINE)) log.fine("CompleteLine - OnHand=" + onHand + " (Unconfirmed=" + unconfirmedShippedQty + ", ToDeliver=" + toDeliver + " - " + line); // @@ -338,7 +338,7 @@ public class InOutGenerate extends SvrProcess BigDecimal deliver = toDeliver; if (deliver.compareTo(onHand) > 0) deliver = onHand; - log.fine("Available - OnHand=" + onHand + if (log.isLoggable(Level.FINE)) log.fine("Available - OnHand=" + onHand + " (Unconfirmed=" + unconfirmedShippedQty + "), ToDeliver=" + toDeliver + ", Delivering=" + deliver + " - " + line); @@ -349,7 +349,7 @@ public class InOutGenerate extends SvrProcess else if (MOrder.DELIVERYRULE_Force.equals(order.getDeliveryRule())) { BigDecimal deliver = toDeliver; - log.fine("Force - OnHand=" + onHand + if (log.isLoggable(Level.FINE)) log.fine("Force - OnHand=" + onHand + " (Unconfirmed=" + unconfirmedShippedQty + "), ToDeliver=" + toDeliver + ", Delivering=" + deliver + " - " + line); @@ -358,11 +358,11 @@ public class InOutGenerate extends SvrProcess } // Manual else if (MOrder.DELIVERYRULE_Manual.equals(order.getDeliveryRule())) - log.fine("Manual - OnHand=" + onHand + if (log.isLoggable(Level.FINE)) log.fine("Manual - OnHand=" + onHand + " (Unconfirmed=" + unconfirmedShippedQty + ") - " + line); else - log.fine("Failed: " + order.getDeliveryRule() + " - OnHand=" + onHand + if (log.isLoggable(Level.FINE)) log.fine("Failed: " + order.getDeliveryRule() + " - OnHand=" + onHand + " (Unconfirmed=" + unconfirmedShippedQty + "), ToDeliver=" + toDeliver + " - " + line); } // for all order lines @@ -450,7 +450,7 @@ public class InOutGenerate extends SvrProcess line.setLine(m_line + orderLine.getLine()); if (!line.save()) throw new IllegalStateException("Could not create Shipment Line"); - log.fine(line.toString()); + if (log.isLoggable(Level.FINE)) log.fine(line.toString()); return; } @@ -506,7 +506,7 @@ public class InOutGenerate extends SvrProcess line.setLine(m_line + orderLine.getLine()); if (!line.save()) throw new IllegalStateException("Could not create Shipment Line"); - log.fine("ToDeliver=" + qty + "/" + deliver + " - " + line); + if (log.isLoggable(Level.FINE)) log.fine("ToDeliver=" + qty + "/" + deliver + " - " + line); toDeliver = toDeliver.subtract(deliver); // Temp adjustment, actual update happen in MInOut.completeIt storage.setQtyOnHand(storage.getQtyOnHand().subtract(deliver)); diff --git a/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java b/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java index 9cf5ae112f..7a98322ec2 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InventoryCountCreate.java @@ -123,13 +123,13 @@ public class InventoryCountCreate extends SvrProcess .append("(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID") .append(" AND Processed='N' AND M_Inventory_ID=").append(p_M_Inventory_ID).append(")"); int no1 = DB.executeUpdate(sql1.toString(), get_TrxName()); - log.fine("doIt - Deleted MA #" + no1); + if (log.isLoggable(Level.FINE)) log.fine("doIt - Deleted MA #" + no1); //End of Added Line StringBuilder sql = new StringBuilder("DELETE M_InventoryLine WHERE Processed='N' ") .append("AND M_Inventory_ID=").append(p_M_Inventory_ID); int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("doIt - Deleted #" + no); + if (log.isLoggable(Level.FINE)) log.fine("doIt - Deleted #" + no); } // Create Null Storage records @@ -156,7 +156,7 @@ public class InventoryCountCreate extends SvrProcess .append("WHERE sl.M_Warehouse_ID=l.M_Warehouse_ID") .append(" AND s.M_Product_ID=p.M_Product_ID)"); int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("'0' Inserted #" + no); + if (log.isLoggable(Level.FINE)) log.fine("'0' Inserted #" + no); } StringBuilder sql = new StringBuilder("SELECT s.M_Product_ID, s.M_Locator_ID, s.M_AttributeSetInstance_ID,"); @@ -394,7 +394,7 @@ public class InventoryCountCreate extends SvrProcess ret.append(","); } } - log.fine(ret.toString()); + if (log.isLoggable(Level.FINE)) log.fine(ret.toString()); StringBuilder msgreturn = new StringBuilder(ret).append(productCategoryId); return msgreturn.toString(); } diff --git a/org.adempiere.base.process/src/org/compiere/process/InventoryValue.java b/org.adempiere.base.process/src/org/compiere/process/InventoryValue.java index fddca19018..fc041f8661 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InventoryValue.java +++ b/org.adempiere.base.process/src/org/compiere/process/InventoryValue.java @@ -17,6 +17,7 @@ package org.compiere.process; import java.sql.Timestamp; +import java.util.logging.Level; import org.compiere.model.MAcctSchema; import org.compiere.model.MClient; @@ -112,7 +113,7 @@ public class InventoryValue extends SvrProcess .append(" INNER JOIN M_CostElement ce ON (c.M_CostElement_ID=ce.M_CostElement_ID AND ce.CostingMethod='S' AND ce.CostElementType='M') ") .append("WHERE w.M_Warehouse_ID=").append(p_M_Warehouse_ID); int noInsertStd = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Inserted Std=" + noInsertStd); + if (log.isLoggable(Level.FINE)) log.fine("Inserted Std=" + noInsertStd); if (noInsertStd == 0) return "No Standard Costs found"; @@ -138,7 +139,7 @@ public class InventoryValue extends SvrProcess .append(" AND iv.M_Product_ID=c.M_Product_ID") .append(" AND iv.M_AttributeSetInstance_ID=c.M_AttributeSetInstance_ID)"); noInsertCost = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Inserted Cost=" + noInsertCost); + if (log.isLoggable(Level.FINE)) log.fine("Inserted Cost=" + noInsertCost); // Update Std Cost Records sql = new StringBuilder ("UPDATE T_InventoryValue iv ") .append("SET (Cost, M_CostElement_ID)=") @@ -156,7 +157,7 @@ public class InventoryValue extends SvrProcess .append("WHERE ivv.AD_PInstance_ID=").append(getAD_PInstance_ID()) .append(" AND ivv.M_CostElement_ID IS NULL)"); int noUpdatedCost = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Updated Cost=" + noUpdatedCost); + if (log.isLoggable(Level.FINE)) log.fine("Updated Cost=" + noUpdatedCost); } if ((noInsertStd+noInsertCost) == 0) return "No Costs found"; @@ -171,7 +172,7 @@ public class InventoryValue extends SvrProcess .append("C_Currency_ID=").append(p_C_Currency_ID) .append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Constants=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Constants=" + no); // Get current QtyOnHand with ASI sql = new StringBuilder ("UPDATE T_InventoryValue iv SET QtyOnHand = ") @@ -183,7 +184,7 @@ public class InventoryValue extends SvrProcess .append("WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()) .append(" AND iv.M_AttributeSetInstance_ID<>0"); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("QtHand with ASI=" + no); + if (log.isLoggable(Level.FINE)) log.fine("QtHand with ASI=" + no); // Get current QtyOnHand without ASI sql = new StringBuilder ("UPDATE T_InventoryValue iv SET QtyOnHand = ") .append("(SELECT SUM(QtyOnHand) FROM M_StorageOnHand s") @@ -193,7 +194,7 @@ public class InventoryValue extends SvrProcess .append("WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID()) .append(" AND iv.M_AttributeSetInstance_ID=0"); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("QtHand w/o ASI=" + no); + if (log.isLoggable(Level.FINE)) log.fine("QtHand w/o ASI=" + no); // Adjust for Valuation Date sql = new StringBuilder("UPDATE T_InventoryValue iv ") @@ -208,7 +209,7 @@ public class InventoryValue extends SvrProcess .append("WHERE iv.M_AttributeSetInstance_ID<>0" ) .append(" AND iv.AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Update with ASI=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Update with ASI=" + no); // sql = new StringBuilder("UPDATE T_InventoryValue iv ") .append("SET QtyOnHand=") @@ -222,13 +223,13 @@ public class InventoryValue extends SvrProcess .append("AND iv.AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Update w/o ASI=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Update w/o ASI=" + no); // Delete Records w/o OnHand Qty sql = new StringBuilder("DELETE T_InventoryValue ") .append("WHERE (QtyOnHand=0 OR QtyOnHand IS NULL) AND AD_PInstance_ID=").append(getAD_PInstance_ID()); int noQty = DB.executeUpdateEx (sql.toString(), get_TrxName()); - log.fine("NoQty Deleted=" + noQty); + if (log.isLoggable(Level.FINE)) log.fine("NoQty Deleted=" + noQty); // Update Prices sql = new StringBuilder("UPDATE T_InventoryValue iv ") @@ -273,7 +274,7 @@ public class InventoryValue extends SvrProcess .append("FROM C_AcctSchema acs WHERE acs.C_AcctSchema_ID=").append(as.getC_AcctSchema_ID()).append(") ") .append("WHERE iv.AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdateEx (sql.toString(), get_TrxName()); - log.fine("Converted=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Converted=" + no); } // Update Values @@ -287,7 +288,7 @@ public class InventoryValue extends SvrProcess .append("WHERE AD_PInstance_ID=").append(getAD_PInstance_ID() ); no = DB.executeUpdateEx(dbeux.toString(), get_TrxName()); - log.fine("Calculation=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Calculation=" + no); // return msg; } // doIt diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java b/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java index b92bff7e1c..5fae9440e1 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java @@ -269,7 +269,7 @@ public class InvoiceGenerate extends SvrProcess // Complete Order if (completeOrder && !fullyDelivered) { - log.fine("Failed CompleteOrder - " + oLine); + if (log.isLoggable(Level.FINE)) log.fine("Failed CompleteOrder - " + oLine); addLog(0, null, null,"Failed CompleteOrder - " + oLine,oLine.get_Table_ID(),oLine.getC_OrderLine_ID()); // Elaine 2008/11/25 completeOrder = false; break; @@ -277,7 +277,7 @@ public class InvoiceGenerate extends SvrProcess // Immediate else if (MOrder.INVOICERULE_Immediate.equals(order.getInvoiceRule())) { - log.fine("Immediate - ToInvoice=" + toInvoice + " - " + oLine); + if (log.isLoggable(Level.FINE)) log.fine("Immediate - ToInvoice=" + toInvoice + " - " + oLine); BigDecimal qtyEntered = toInvoice; // Correct UOM for QtyEntered if (oLine.getQtyEntered().compareTo(oLine.getQtyOrdered()) != 0) @@ -288,7 +288,7 @@ public class InvoiceGenerate extends SvrProcess } else { - log.fine("Failed: " + order.getInvoiceRule() + if (log.isLoggable(Level.FINE)) log.fine("Failed: " + order.getInvoiceRule() + " - ToInvoice=" + toInvoice + " - " + oLine); addLog(0, null, null,"Failed: " + order.getInvoiceRule() + " - ToInvoice=" + toInvoice + " - " + oLine,oLine.get_Table_ID(),oLine.getC_OrderLine_ID()); @@ -363,7 +363,7 @@ public class InvoiceGenerate extends SvrProcess line.setLine(m_line + orderLine.getLine()); if (!line.save()) throw new IllegalStateException("Could not create Invoice Line (o)"); - log.fine(line.toString()); + if (log.isLoggable(Level.FINE)) log.fine(line.toString()); } // createLine /** @@ -436,7 +436,7 @@ public class InvoiceGenerate extends SvrProcess if (!sLine.save()) throw new IllegalStateException("Could not update Shipment Line"); - log.fine(line.toString()); + if (log.isLoggable(Level.FINE)) log.fine(line.toString()); } // createLine diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoicePrint.java b/org.adempiere.base.process/src/org/compiere/process/InvoicePrint.java index a65d3f4feb..95daeb5c29 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoicePrint.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoicePrint.java @@ -210,7 +210,7 @@ public class InvoicePrint extends SvrProcess } } sql.append(" ORDER BY i.C_Invoice_ID, pf.AD_Org_ID DESC"); // more than 1 PF record - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); MPrintFormat format = null; int old_AD_PrintFormat_ID = -1; @@ -313,7 +313,7 @@ public class InvoicePrint extends SvrProcess if (!Ini.isClient()) invoice = new File(MInvoice.getPDFFileName(documentDir, C_Invoice_ID)); File attachment = re.getPDF(invoice); - log.fine(to + " - " + attachment); + if (log.isLoggable(Level.FINE)) log.fine(to + " - " + attachment); email.addAttachment(attachment); // String msg = email.send(); diff --git a/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java b/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java index 324e9181e0..352bbb82da 100644 --- a/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java +++ b/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java @@ -108,7 +108,7 @@ public class M_PriceList_Create extends SvrProcess { "Update The PriceList to zero of M_Product_PO WHERE PriceList IS NULL", sqlupd.toString()); totu += cntu; - log.fine("Updated " + cntu); + if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu); sqlupd = new StringBuilder("UPDATE M_Product_PO SET PriceLastPO = 0 "); sqlupd.append(" WHERE PriceLastPO IS NULL "); @@ -119,7 +119,7 @@ public class M_PriceList_Create extends SvrProcess { "Update The PriceListPO to zero of M_Product_PO WHERE PriceLastPO IS NULL", sqlupd.toString()); totu += cntu; - log.fine("Updated " + cntu); + if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu); sqlupd = new StringBuilder("UPDATE M_Product_PO SET PricePO = PriceLastPO "); sqlupd.append(" WHERE (PricePO IS NULL OR PricePO = 0) AND PriceLastPO <> 0 "); @@ -130,7 +130,7 @@ public class M_PriceList_Create extends SvrProcess { "Update The PricePO to PriceLastPO of M_Product_PO WHERE (PricePO IS NULL OR PricePO = 0) AND PriceLastPO <> 0 ", sqlupd.toString()); totu += cntu; - log.fine("Updated " + cntu); + if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu); sqlupd = new StringBuilder("UPDATE M_Product_PO SET PricePO = 0 "); sqlupd.append(" WHERE PricePO IS NULL "); @@ -141,7 +141,7 @@ public class M_PriceList_Create extends SvrProcess { "Update The PricePO to Zero of M_Product_PO WHERE PricePO IS NULL", sqlupd.toString()); totu += cntu; - log.fine("Updated " + cntu); + if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu); // // Set default current vendor // @@ -155,7 +155,7 @@ public class M_PriceList_Create extends SvrProcess { if (cntu == -1) raiseError("Update IsCurrentVendor to Y of M_Product_PO ", sqlupd.toString()); totu += cntu; - log.fine("Updated " + cntu); + if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu); // let the commit for SvrProcess // DB.commit(true, get_TrxName()); @@ -206,7 +206,7 @@ public class M_PriceList_Create extends SvrProcess { "Update IsCurrentVendor to N of M_Product_PO for a M_Product_ID and C_BPartner_ID ingresed", sqlupd.toString()); totu += cntu; - log.fine("Updated " + cntu); + if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu); } } } catch (SQLException e) { @@ -232,7 +232,7 @@ public class M_PriceList_Create extends SvrProcess { raiseError(" DELETE M_ProductPrice ", sqldel.toString()); totd += cntd; message = new StringBuilder("@Deleted@=").append(cntd).append(" - "); - log.fine("Deleted " + cntd); + if (log.isLoggable(Level.FINE)) log.fine("Deleted " + cntd); } // // Get PriceList Info @@ -284,7 +284,7 @@ public class M_PriceList_Create extends SvrProcess { if (cntd == -1) raiseError(" DELETE T_Selection ", sqldel.toString()); totd += cntd; - log.fine("Deleted " + cntd); + if (log.isLoggable(Level.FINE)) log.fine("Deleted " + cntd); // //Create Selection in temporary table // @@ -332,7 +332,7 @@ public class M_PriceList_Create extends SvrProcess { if (cnti == -1) raiseError(" INSERT INTO T_Selection ", sqlins.toString()); toti += cnti; - log.fine("Inserted " + cnti); + if (log.isLoggable(Level.FINE)) log.fine("Inserted " + cnti); } else { // @@ -382,7 +382,7 @@ public class M_PriceList_Create extends SvrProcess { " INSERT INTO T_Selection from existing PriceList", sqlins.toString()); toti += cnti; - log.fine("Inserted " + cnti); + if (log.isLoggable(Level.FINE)) log.fine("Inserted " + cnti); } @@ -405,7 +405,7 @@ public class M_PriceList_Create extends SvrProcess { raiseError(" DELETE M_ProductPrice ", sqldel.toString()); totd += cntd; message.append(", @Deleted@=").append(cntd); - log.fine("Deleted " + cntd); + if (log.isLoggable(Level.FINE)) log.fine("Deleted " + cntd); } // @@ -499,7 +499,7 @@ public class M_PriceList_Create extends SvrProcess { " INSERT INTO T_Selection from existing PriceList", sqlins.toString()); toti += cnti; - log.fine("Inserted " + cnti); + if (log.isLoggable(Level.FINE)) log.fine("Inserted " + cnti); } else { // //Copy and Convert from other PriceList_Version @@ -572,7 +572,7 @@ public class M_PriceList_Create extends SvrProcess { " INSERT INTO T_Selection from existing PriceList", sqlins.toString()); toti += cnti; - log.fine("Inserted " + cnti); + if (log.isLoggable(Level.FINE)) log.fine("Inserted " + cnti); } message.append(", @Inserted@=").append(cnti); @@ -612,7 +612,7 @@ public class M_PriceList_Create extends SvrProcess { if (cntu == -1) raiseError("Update M_ProductPrice ", sqlupd.toString()); totu += cntu; - log.fine("Updated " + cntu); + if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu); // //Rounding (AD_Reference_ID=155) @@ -665,7 +665,7 @@ public class M_PriceList_Create extends SvrProcess { if (cntu == -1) raiseError("Update M_ProductPrice ", sqlupd.toString()); totu += cntu; - log.fine("Updated " + cntu); + if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu); message.append(", @Updated@=").append(cntu); // @@ -691,7 +691,7 @@ public class M_PriceList_Create extends SvrProcess { if (cntu == -1) raiseError("Update M_ProductPrice ", sqlupd.toString()); totu += cntu; - log.fine("Updated " + cntu); + if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu); v_NextNo = v_NextNo + 1; addLog(0, null, null, message.toString()); @@ -705,7 +705,7 @@ public class M_PriceList_Create extends SvrProcess { if (cntd == -1) raiseError(" DELETE T_Selection ", sqldel.toString()); totd += cntd; - log.fine("Deleted " + cntd); + if (log.isLoggable(Level.FINE)) log.fine("Deleted " + cntd); // //commit; @@ -797,7 +797,7 @@ public class M_PriceList_Create extends SvrProcess { ret.append(","); } } - log.fine(ret.toString()); + if (log.isLoggable(Level.FINE)) log.fine(ret.toString()); return ret.toString() + productCategoryId; } diff --git a/org.adempiere.base.process/src/org/compiere/process/M_Product_BOM_Check.java b/org.adempiere.base.process/src/org/compiere/process/M_Product_BOM_Check.java index f1c0f0c5e6..657b621df7 100644 --- a/org.adempiere.base.process/src/org/compiere/process/M_Product_BOM_Check.java +++ b/org.adempiere.base.process/src/org/compiere/process/M_Product_BOM_Check.java @@ -130,7 +130,7 @@ public class M_Product_BOM_Check extends SvrProcess rs = null; pstmt = null; } - log.fine("Count T_Selection =" + countno); + if (log.isLoggable(Level.FINE)) log.fine("Count T_Selection =" + countno); if (countno == 0) break; diff --git a/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java b/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java index a889e2c647..53ac1734e4 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrderPOCreate.java @@ -162,7 +162,7 @@ public class OrderPOCreate extends SvrProcess rs = null; pstmt = null; } if (counter == 0) - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); StringBuilder msgreturn = new StringBuilder("@Created@ ").append(counter); return msgreturn.toString(); } // doIt diff --git a/org.adempiere.base.process/src/org/compiere/process/OrgOwnership.java b/org.adempiere.base.process/src/org/compiere/process/OrgOwnership.java index 6213572be1..6f97c475d7 100644 --- a/org.adempiere.base.process/src/org/compiere/process/OrgOwnership.java +++ b/org.adempiere.base.process/src/org/compiere/process/OrgOwnership.java @@ -180,7 +180,7 @@ public class OrgOwnership extends SvrProcess else set.append(" WHERE M_Product_ID=").append(p_M_Product_ID); set.append(" AND AD_Client_ID=").append(getAD_Client_ID()).append(" AND AD_Org_ID<>").append(p_AD_Org_ID); - log.fine("productOwnership - " + set); + if (log.isLoggable(Level.FINE)) log.fine("productOwnership - " + set); // Product StringBuilder sql = new StringBuilder("UPDATE M_Product x ").append(set); @@ -225,7 +225,7 @@ public class OrgOwnership extends SvrProcess else set.append(" WHERE C_BPartner_ID=").append(p_C_BPartner_ID); set.append(" AND AD_Client_ID=").append(getAD_Client_ID()).append(" AND AD_Org_ID<>").append(p_AD_Org_ID); - log.fine("bPartnerOwnership - " + set.toString()); + if (log.isLoggable(Level.FINE)) log.fine("bPartnerOwnership - " + set.toString()); // BPartner StringBuilder sql = new StringBuilder("UPDATE C_BPartner x ").append(set); @@ -274,31 +274,31 @@ public class OrgOwnership extends SvrProcess StringBuilder sql = new StringBuilder("UPDATE R_ContactInterest ").append(set); int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("generalOwnership - R_ContactInterest=" + no); + if (log.isLoggable(Level.FINE)) log.fine("generalOwnership - R_ContactInterest=" + no); // AD_User_Roles sql = new StringBuilder("UPDATE AD_User_Roles ").append(set); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("generalOwnership - AD_User_Roles=" + no); + if (log.isLoggable(Level.FINE)) log.fine("generalOwnership - AD_User_Roles=" + no); // C_BPartner_Product sql = new StringBuilder("UPDATE C_BPartner_Product ").append(set); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("generalOwnership - C_BPartner_Product=" + no); + if (log.isLoggable(Level.FINE)) log.fine("generalOwnership - C_BPartner_Product=" + no); // Withholding sql = new StringBuilder("UPDATE C_BP_Withholding x ").append(set); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("generalOwnership - C_BP_Withholding=" + no); + if (log.isLoggable(Level.FINE)) log.fine("generalOwnership - C_BP_Withholding=" + no); // Replenish sql = new StringBuilder("UPDATE M_Replenish ").append(set); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("generalOwnership - M_Replenish=" + no); + if (log.isLoggable(Level.FINE)) log.fine("generalOwnership - M_Replenish=" + no); } // generalOwnership diff --git a/org.adempiere.base.process/src/org/compiere/process/RegisterSystem.java b/org.adempiere.base.process/src/org/compiere/process/RegisterSystem.java index cdbc94f307..b783036e42 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RegisterSystem.java +++ b/org.adempiere.base.process/src/org/compiere/process/RegisterSystem.java @@ -127,7 +127,7 @@ public class RegisterSystem extends SvrProcess .append("&NumInvoice=").append(URLEncoder.encode(String.valueOf( DB.getSQLValue(null, "SELECT Count(*) FROM C_Invoice")), enc)); } - log.fine(urlString.toString()); + if (log.isLoggable(Level.FINE)) log.fine(urlString.toString()); // Send it URL url = new URL (urlString.toString()); diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java b/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java index 6a784a1598..0f603f623c 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplenishReport.java @@ -144,7 +144,7 @@ public class ReplenishReport extends SvrProcess .append("WHERE Level_Max < Level_Min"); int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Corrected Max_Level=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Corrected Max_Level=" + no); // Minimum Order should be 1 sql = new StringBuilder("UPDATE M_Product_PO") @@ -152,7 +152,7 @@ public class ReplenishReport extends SvrProcess .append("WHERE Order_Min IS NULL OR Order_Min < 1"); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Corrected Order Min=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Corrected Order Min=" + no); // Pack should be 1 sql = new StringBuilder("UPDATE M_Product_PO") @@ -160,7 +160,7 @@ public class ReplenishReport extends SvrProcess .append("WHERE Order_Pack IS NULL OR Order_Pack < 1"); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Corrected Order Pack=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Corrected Order Pack=" + no); // Set Current Vendor where only one vendor @@ -173,7 +173,7 @@ public class ReplenishReport extends SvrProcess .append("HAVING COUNT(*) = 1)"); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Corrected CurrentVendor(Y)=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Corrected CurrentVendor(Y)=" + no); // More then one current vendor sql = new StringBuilder("UPDATE M_Product_PO p") @@ -185,13 +185,13 @@ public class ReplenishReport extends SvrProcess .append("HAVING COUNT(*) > 1)"); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Corrected CurrentVendor(N)=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Corrected CurrentVendor(N)=" + no); // Just to be sure sql = new StringBuilder("DELETE T_Replenish WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Delete Existing Temp=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Existing Temp=" + no); } // prepareTable /** @@ -223,7 +223,7 @@ public class ReplenishReport extends SvrProcess sql.append(" AND po.C_BPartner_ID=").append(p_C_BPartner_ID); int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (log.isLoggable(Level.FINEST)) log.finest(sql.toString()); - log.fine("Insert (1) #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Insert (1) #" + no); if (p_C_BPartner_ID == 0) { @@ -246,7 +246,7 @@ public class ReplenishReport extends SvrProcess sql.append("WHERE r.M_Product_ID=t.M_Product_ID"); sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()).append(")"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Insert (BP) #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Insert (BP) #" + no); } sql = new StringBuilder("UPDATE T_Replenish t SET "); sql.append("QtyOnHand = (SELECT COALESCE(SUM(QtyOnHand),0) FROM M_StorageOnHand s, M_Locator l WHERE t.M_Product_ID=s.M_Product_ID"); @@ -260,7 +260,7 @@ public class ReplenishReport extends SvrProcess sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Update #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Update #" + no); // Delete inactive products and replenishments sql = new StringBuilder("DELETE T_Replenish r "); @@ -272,7 +272,7 @@ public class ReplenishReport extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Delete Inactive=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Inactive=" + no); // Ensure Data consistency sql = new StringBuilder("UPDATE T_Replenish SET QtyOnHand = 0 WHERE QtyOnHand IS NULL"); @@ -292,7 +292,7 @@ public class ReplenishReport extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Update Type-1=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Update Type-1=" + no); // // X_M_Replenish.REPLENISHTYPE_MaintainMaximumLevel sql = new StringBuilder("UPDATE T_Replenish"); @@ -301,7 +301,7 @@ public class ReplenishReport extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Update Type-2=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Update Type-2=" + no); // Minimum Order Quantity @@ -312,7 +312,7 @@ public class ReplenishReport extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set MinOrderQty=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set MinOrderQty=" + no); // Even dividable by Pack sql = new StringBuilder("UPDATE T_Replenish"); @@ -322,7 +322,7 @@ public class ReplenishReport extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set OrderPackQty=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set OrderPackQty=" + no); // Source from other warehouse if (wh.getM_WarehouseSource_ID() != 0) @@ -332,7 +332,7 @@ public class ReplenishReport extends SvrProcess sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set Source Warehouse=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Source Warehouse=" + no); } // Check Source Warehouse sql = new StringBuilder("UPDATE T_Replenish"); @@ -341,7 +341,7 @@ public class ReplenishReport extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set same Source Warehouse=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set same Source Warehouse=" + no); // Custom Replenishment String className = wh.getReplenishmentClass(); @@ -388,7 +388,7 @@ public class ReplenishReport extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Delete No QtyToOrder=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete No QtyToOrder=" + no); } // fillTable /** @@ -424,7 +424,7 @@ public class ReplenishReport extends SvrProcess order.setM_Warehouse_ID(wh.getM_Warehouse_ID()); if (!order.save()) return; - log.fine(order.toString()); + if (log.isLoggable(Level.FINE)) log.fine(order.toString()); noOrders++; info.append(" - "); info.append(order.getDocumentNo()); @@ -468,7 +468,7 @@ public class ReplenishReport extends SvrProcess requisition.setM_Warehouse_ID(wh.getM_Warehouse_ID()); if (!requisition.save()) return; - log.fine(requisition.toString()); + if (log.isLoggable(Level.FINE)) log.fine(requisition.toString()); noReqs++; info.append(" - "); info.append(requisition.getDocumentNo()); @@ -525,7 +525,7 @@ public class ReplenishReport extends SvrProcess move.setAD_Org_ID(whSource.getAD_Org_ID()); if (!move.save()) return; - log.fine(move.toString()); + if (log.isLoggable(Level.FINE)) log.fine(move.toString()); noMoves++; info.append(" - ").append(move.getDocumentNo()); } @@ -648,7 +648,7 @@ public class ReplenishReport extends SvrProcess if (!order.save()) return; - log.fine(order.toString()); + if (log.isLoggable(Level.FINE)) log.fine(order.toString()); noMoves++; info.append(" - ").append(order.getDocumentNo()); } diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java b/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java index 3271c8a6b5..97efed83a4 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplenishReportProduction.java @@ -155,7 +155,7 @@ public class ReplenishReportProduction extends SvrProcess .append("WHERE Level_Max < Level_Min"); int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Corrected Max_Level=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Corrected Max_Level=" + no); // Minimum Order should be 1 sql = new StringBuilder("UPDATE M_Product_PO") @@ -163,7 +163,7 @@ public class ReplenishReportProduction extends SvrProcess .append("WHERE Order_Min IS NULL OR Order_Min < 1"); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Corrected Order Min=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Corrected Order Min=" + no); // Pack should be 1 sql = new StringBuilder("UPDATE M_Product_PO") @@ -171,7 +171,7 @@ public class ReplenishReportProduction extends SvrProcess .append("WHERE Order_Pack IS NULL OR Order_Pack < 1"); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Corrected Order Pack=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Corrected Order Pack=" + no); // Set Current Vendor where only one vendor sql = new StringBuilder("UPDATE M_Product_PO p") @@ -183,7 +183,7 @@ public class ReplenishReportProduction extends SvrProcess .append("HAVING COUNT(*) = 1)"); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Corrected CurrentVendor(Y)=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Corrected CurrentVendor(Y)=" + no); // More then one current vendor sql = new StringBuilder("UPDATE M_Product_PO p") @@ -195,13 +195,13 @@ public class ReplenishReportProduction extends SvrProcess .append("HAVING COUNT(*) > 1)"); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Corrected CurrentVendor(N)=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Corrected CurrentVendor(N)=" + no); // Just to be sure sql = new StringBuilder("DELETE T_Replenish WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Delete Existing Temp=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Existing Temp=" + no); } // prepareTable /** @@ -237,7 +237,7 @@ public class ReplenishReportProduction extends SvrProcess sql.append(" AND p.IsKanban = '").append(isKanban).append("' "); int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (log.isLoggable(Level.FINEST)) log.finest(sql.toString()); - log.fine("Insert (1) #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Insert (1) #" + no); if (p_C_BPartner_ID == 0) { @@ -265,7 +265,7 @@ public class ReplenishReportProduction extends SvrProcess if ( isKanban != null ) sql.append(" AND p.IsKanban = '").append(isKanban).append("' "); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Insert (BP) #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Insert (BP) #" + no); } sql = new StringBuilder("UPDATE T_Replenish t SET "); @@ -280,7 +280,7 @@ public class ReplenishReportProduction extends SvrProcess sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Update #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Update #" + no); // add production lines sql = new StringBuilder("UPDATE T_Replenish t SET "); @@ -293,7 +293,7 @@ public class ReplenishReportProduction extends SvrProcess sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Update #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Update #" + no); // Delete inactive products and replenishments @@ -306,7 +306,7 @@ public class ReplenishReportProduction extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Delete Inactive=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Inactive=" + no); // Ensure Data consistency sql = new StringBuilder("UPDATE T_Replenish SET QtyOnHand = 0 WHERE QtyOnHand IS NULL"); @@ -326,7 +326,7 @@ public class ReplenishReportProduction extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Update Type-1=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Update Type-1=" + no); // // X_M_Replenish.REPLENISHTYPE_MaintainMaximumLevel sql = new StringBuilder("UPDATE T_Replenish"); @@ -335,7 +335,7 @@ public class ReplenishReportProduction extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Update Type-2=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Update Type-2=" + no); // Minimum Order Quantity @@ -346,7 +346,7 @@ public class ReplenishReportProduction extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set MinOrderQty=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set MinOrderQty=" + no); // Even dividable by Pack sql = new StringBuilder("UPDATE T_Replenish"); @@ -356,7 +356,7 @@ public class ReplenishReportProduction extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set OrderPackQty=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set OrderPackQty=" + no); // Source from other warehouse if (wh.getM_WarehouseSource_ID() != 0) @@ -366,7 +366,7 @@ public class ReplenishReportProduction extends SvrProcess sql.append(" WHERE AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set Source Warehouse=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Source Warehouse=" + no); } // Check Source Warehouse sql = new StringBuilder("UPDATE T_Replenish"); @@ -375,7 +375,7 @@ public class ReplenishReportProduction extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Set same Source Warehouse=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set same Source Warehouse=" + no); // Custom Replenishment String className = wh.getReplenishmentClass(); @@ -422,7 +422,7 @@ public class ReplenishReportProduction extends SvrProcess sql.append(" AND AD_PInstance_ID=").append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) - log.fine("Delete No QtyToOrder=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete No QtyToOrder=" + no); } // fillTable @@ -459,7 +459,7 @@ public class ReplenishReportProduction extends SvrProcess order.setM_Warehouse_ID(wh.getM_Warehouse_ID()); if (!order.save()) return; - log.fine(order.toString()); + if (log.isLoggable(Level.FINE)) log.fine(order.toString()); noOrders++; info.append(" - "); info.append(order.getDocumentNo()); @@ -503,7 +503,7 @@ public class ReplenishReportProduction extends SvrProcess requisition.setM_Warehouse_ID(wh.getM_Warehouse_ID()); if (!requisition.save()) return; - log.fine(requisition.toString()); + if (log.isLoggable(Level.FINE)) log.fine(requisition.toString()); noReqs++; info.append(" - "); info.append(requisition.getDocumentNo()); @@ -561,7 +561,7 @@ public class ReplenishReportProduction extends SvrProcess move.setAD_Org_ID(whSource.getAD_Org_ID()); if (!move.save()) return; - log.fine(move.toString()); + if (log.isLoggable(Level.FINE)) log.fine(move.toString()); noMoves++; info.append(" - ").append(move.getDocumentNo()); } @@ -684,7 +684,7 @@ public class ReplenishReportProduction extends SvrProcess if (!order.save()) return; - log.fine(order.toString()); + if (log.isLoggable(Level.FINE)) log.fine(order.toString()); noMoves++; info.append(" - ").append(order.getDocumentNo()); } @@ -814,7 +814,7 @@ public class ReplenishReportProduction extends SvrProcess production.setIsCreated("Y"); production.saveEx(get_TrxName()); - log.fine(production.toString()); + if (log.isLoggable(Level.FINE)) log.fine(production.toString()); noProds++; info.append(" - "); info.append(production.getDocumentNo()); diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java b/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java index 35d0966489..df267a09a1 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java @@ -280,7 +280,7 @@ public class ReplicationLocal extends SvrProcess data.CentralData = getRowSet(data.Sql, null); if (data.CentralData == null) { - log.fine("mergeDataTable - CentralData is Null - " + TableName); + if (log.isLoggable(Level.FINE)) log.fine("mergeDataTable - CentralData is Null - " + TableName); m_replicated = false; return false; } @@ -312,7 +312,7 @@ public class ReplicationLocal extends SvrProcess {data.TableName, data.KeyColumns, sourceRS, targetRS, m_test, Boolean.TRUE}); boolean replicated = isReplicated(result); if (replicated) - log.fine("mergeDataTable -> " + TableName + " - " + result); + if (log.isLoggable(Level.FINE)) log.fine("mergeDataTable -> " + TableName + " - " + result); else { m_replicated = false; @@ -458,7 +458,7 @@ public class ReplicationLocal extends SvrProcess data.CentralData = getRowSet(data.Sql, null); if (data.CentralData == null) { - log.fine("sendUpdatesTable - Null - " + TableName); + if (log.isLoggable(Level.FINE)) log.fine("sendUpdatesTable - Null - " + TableName); m_replicated = false; return false; } @@ -471,17 +471,17 @@ public class ReplicationLocal extends SvrProcess } catch (SQLException ex) { - log.fine("RowCheck " + ex); + if (log.isLoggable(Level.FINE)) log.fine("RowCheck " + ex); m_replicated = false; return false; } if (rows == 0) { - log.fine("No Rows - " + TableName); + if (log.isLoggable(Level.FINE)) log.fine("No Rows - " + TableName); return true; } else - log.fine(TableName + " #" + rows); + if (log.isLoggable(Level.FINE)) log.fine(TableName + " #" + rows); // Process Info ProcessInfo pi = new ProcessInfo("SendUpdates", 0); diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplicationRemote.java b/org.adempiere.base.process/src/org/compiere/process/ReplicationRemote.java index cd790a7aa0..7b63065728 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplicationRemote.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplicationRemote.java @@ -111,7 +111,7 @@ public class ReplicationRemote extends SvrProcess //int AD_Table_ID = rs.getInt(1); String ReplicationType = rs.getString(2); String TableName = rs.getString(3); - log.fine("setupRemote - " + TableName + " - " + ReplicationType); + if (log.isLoggable(Level.FINE)) log.fine("setupRemote - " + TableName + " - " + ReplicationType); if (!data.Test.booleanValue()) setupRemoteAD_Table(TableName, ReplicationType); } @@ -237,7 +237,7 @@ public class ReplicationRemote extends SvrProcess RowSet targetRS = ReplicationLocal.getRowSet(data.Sql, null); Object result = doIt (ReplicationLocal.START, "sync", new Object[] // Merge {data.TableName, data.KeyColumns, sourceRS, targetRS, data.Test, Boolean.TRUE}); - log.fine("receiveUpdateFromCentral - " + data.TableName + " - " + result); + if (log.isLoggable(Level.FINE)) log.fine("receiveUpdateFromCentral - " + data.TableName + " - " + result); pi.setSerializableObject(null); boolean replicated = ReplicationLocal.isReplicated(result); if (!replicated) @@ -280,7 +280,7 @@ public class ReplicationRemote extends SvrProcess RowSet targetRS = ReplicationLocal.getRowSet(data.Sql, null); Object result = doIt (ReplicationLocal.START, "sync", new Object[] // Sync {data.TableName, data.KeyColumns, sourceRS, targetRS, data.Test, Boolean.FALSE}); - log.fine("receiveUpdateFromCentral - " + data.TableName + " - " + result); + if (log.isLoggable(Level.FINE)) log.fine("receiveUpdateFromCentral - " + data.TableName + " - " + result); pi.setSerializableObject(null); boolean replicated = ReplicationLocal.isReplicated(result); if (!replicated) diff --git a/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java b/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java index f791882fcc..79f162f59f 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java +++ b/org.adempiere.base.process/src/org/compiere/process/RequestEMailProcessor.java @@ -186,7 +186,7 @@ public class RequestEMailProcessor extends SvrProcess // m_session = Session.getDefaultInstance(props, auth); m_session.setDebug(CLogMgt.isLevelFinest()); - log.fine("getSession - " + m_session); + if (log.isLoggable(Level.FINE)) log.fine("getSession - " + m_session); return m_session; } // getSession @@ -208,7 +208,7 @@ public class RequestEMailProcessor extends SvrProcess // Connect m_store.connect(); // - log.fine("getStore - " + m_store); + if (log.isLoggable(Level.FINE)) log.fine("getStore - " + m_store); return m_store; } // getStore @@ -229,7 +229,7 @@ public class RequestEMailProcessor extends SvrProcess if (!inbox.exists()) throw new IllegalStateException("No Inbox"); inbox.open(Folder.READ_WRITE); - log.fine("processInBox - " + inbox.getName() + if (log.isLoggable(Level.FINE)) log.fine("processInBox - " + inbox.getName() + "; Messages Total=" + inbox.getMessageCount() + "; New=" + inbox.getNewMessageCount()); diff --git a/org.adempiere.base.process/src/org/compiere/process/RfQResponseRank.java b/org.adempiere.base.process/src/org/compiere/process/RfQResponseRank.java index 05fbc904e3..79bcc001e3 100644 --- a/org.adempiere.base.process/src/org/compiere/process/RfQResponseRank.java +++ b/org.adempiere.base.process/src/org/compiere/process/RfQResponseRank.java @@ -82,7 +82,7 @@ public class RfQResponseRank extends SvrProcess // Get Completed, Active Responses MRfQResponse[] responses = rfq.getResponses (true, true); - log.fine("doIt - #Responses=" + responses.length); + if (log.isLoggable(Level.FINE)) log.fine("doIt - #Responses=" + responses.length); if (responses.length == 0) throw new IllegalArgumentException("No completed RfQ Responses found"); if (responses.length == 1) @@ -120,7 +120,7 @@ public class RfQResponseRank extends SvrProcess MRfQLine rfqLine = rfqLines[i]; if (!rfqLine.isActive()) continue; - log.fine("rankLines - " + rfqLine); + if (log.isLoggable(Level.FINE)) log.fine("rankLines - " + rfqLine); MRfQLineQty[] rfqQtys = rfqLine.getQtys(); for (int j = 0; j < rfqQtys.length; j++) { @@ -128,7 +128,7 @@ public class RfQResponseRank extends SvrProcess MRfQLineQty rfqQty = rfqQtys[j]; if (!rfqQty.isActive() || !rfqQty.isRfQQty()) continue; - log.fine("rankLines Qty - " + rfqQty); + if (log.isLoggable(Level.FINE)) log.fine("rankLines Qty - " + rfqQty); MRfQResponseLineQty[] respQtys = rfqQty.getResponseQtys(false); for (int kk = 0; kk < respQtys.length; kk++) { @@ -138,14 +138,14 @@ public class RfQResponseRank extends SvrProcess { respQty.setRanking(999); respQty.saveEx(); - log.fine(" - ignored: " + respQty); + if (log.isLoggable(Level.FINE)) log.fine(" - ignored: " + respQty); } } // for all respones line qtys // Rank RfQ Line Qtys respQtys = rfqQty.getResponseQtys(false); if (respQtys.length == 0) - log.fine(" - No Qtys with valid Amounts"); + if (log.isLoggable(Level.FINE)) log.fine(" - No Qtys with valid Amounts"); else { Arrays.sort(respQtys, respQtys[0]); @@ -164,7 +164,7 @@ public class RfQResponseRank extends SvrProcess { qty.setRanking(999); qty.saveEx(); - log.fine(" - Rank 999: " + qty); + if (log.isLoggable(Level.FINE)) log.fine(" - Rank 999: " + qty); continue; } @@ -174,7 +174,7 @@ public class RfQResponseRank extends SvrProcess lastAmt = qty.getNetAmt(); } qty.setRanking(lastRank); - log.fine(" - Rank " + lastRank + ": " + qty); + if (log.isLoggable(Level.FINE)) log.fine(" - Rank " + lastRank + ": " + qty); qty.saveEx(); // if (rank == 0) // Update RfQ @@ -224,7 +224,7 @@ public class RfQResponseRank extends SvrProcess } response.setRanking(ranking); response.saveEx(); - log.fine("- Response Ranking " + ranking + ": " + response); + if (log.isLoggable(Level.FINE)) log.fine("- Response Ranking " + ranking + ": " + response); if (!rfq.isQuoteSelectedLines()) // no total selected winner if not all lines { if (winner == null && ranking > 0) @@ -239,7 +239,7 @@ public class RfQResponseRank extends SvrProcess { winner.setIsSelectedWinner(true); winner.saveEx(); - log.fine("- Response Winner: " + winner); + if (log.isLoggable(Level.FINE)) log.fine("- Response Winner: " + winner); } } // rankLines @@ -272,7 +272,7 @@ public class RfQResponseRank extends SvrProcess response.setIsSelectedWinner(false); } response.saveEx(); - log.fine("rankResponse - " + response); + if (log.isLoggable(Level.FINE)) log.fine("rankResponse - " + response); } } // rankResponses diff --git a/org.adempiere.base.process/src/org/compiere/process/SendMailText.java b/org.adempiere.base.process/src/org/compiere/process/SendMailText.java index e108d88759..03eb16f3ff 100644 --- a/org.adempiere.base.process/src/org/compiere/process/SendMailText.java +++ b/org.adempiere.base.process/src/org/compiere/process/SendMailText.java @@ -116,7 +116,7 @@ public class SendMailText extends SvrProcess if (m_from.getAD_User_ID() == 0) throw new Exception ("No found @AD_User_ID@=" + m_AD_User_ID); } - log.fine("From " + m_from); + if (log.isLoggable(Level.FINE)) log.fine("From " + m_from); long start = System.currentTimeMillis(); if (m_R_InterestArea_ID > 0) @@ -284,7 +284,7 @@ public class SendMailText extends SvrProcess new MUserMail(m_MailText, AD_User_ID, email).saveEx(); // if (OK) - log.fine(to.getEMail()); + if (log.isLoggable(Level.FINE)) log.fine(to.getEMail()); else log.warning("FAILURE - " + to.getEMail()); StringBuilder msglog = new StringBuilder((OK ? "@OK@" : "@ERROR@")).append(" - ").append(to.getEMail()); diff --git a/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java b/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java index 7a22cd2705..3423884e16 100644 --- a/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java +++ b/org.adempiere.base.process/src/org/compiere/process/TableCreateColumns.java @@ -167,7 +167,7 @@ public class TableCreateColumns extends SvrProcess || tn.indexOf("EXPLAIN") != -1 // explain plan ) { - log.fine("Ignored: " + tableName + " - " + tableType); + if (log.isLoggable(Level.FINE)) log.fine("Ignored: " + tableName + " - " + tableType); continue; } // diff --git a/org.adempiere.base.process/src/org/compiere/process/TransactionXRef.java b/org.adempiere.base.process/src/org/compiere/process/TransactionXRef.java index 83afc16e94..d334afa0e8 100644 --- a/org.adempiere.base.process/src/org/compiere/process/TransactionXRef.java +++ b/org.adempiere.base.process/src/org/compiere/process/TransactionXRef.java @@ -134,7 +134,7 @@ public class TransactionXRef extends SvrProcess .append(") ORDER BY M_Transaction_ID"); // int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); if (log.isLoggable(Level.CONFIG)) log.config("#" + no); // Multi-Level diff --git a/org.adempiere.base.process/src/org/compiere/process/UserPassword.java b/org.adempiere.base.process/src/org/compiere/process/UserPassword.java index 47fd389231..31164246ab 100644 --- a/org.adempiere.base.process/src/org/compiere/process/UserPassword.java +++ b/org.adempiere.base.process/src/org/compiere/process/UserPassword.java @@ -82,7 +82,7 @@ public class UserPassword extends SvrProcess MUser user = MUser.get(getCtx(), p_AD_User_ID); user.load(get_TrxName()); MUser operator = MUser.get(getCtx(), getAD_User_ID()); - log.fine("User=" + user + ", Operator=" + operator); + if (log.isLoggable(Level.FINE)) log.fine("User=" + user + ", Operator=" + operator); boolean hash_password = MSysConfig.getBooleanValue(MSysConfig.USER_PASSWORD_HASH, false); diff --git a/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java b/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java index 68bdf41b5a..643ad19430 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/AbstractExcelExporter.java @@ -35,7 +35,6 @@ import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.compiere.Adempiere; -import org.compiere.util.CLogMgt; import org.compiere.util.CLogger; import org.compiere.util.DisplayType; import org.compiere.util.Env; @@ -457,7 +456,7 @@ public abstract class AbstractExcelExporter // // Workbook Info - if (CLogMgt.isLevelFine()) { + if (log.isLoggable(Level.FINE)) { log.fine("Sheets #"+m_sheetCount); log.fine("Styles used #"+m_styles.size()); } diff --git a/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java b/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java index 331b2f8373..60f5594749 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/GridTabCSVImporter.java @@ -28,6 +28,7 @@ import java.util.Calendar; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.logging.Level; import java.util.UUID; import org.adempiere.base.IGridTabImporter; @@ -195,7 +196,7 @@ public class GridTabCSVImporter implements IGridTabImporter StringBuilder lineError = new StringBuilder(); String headName = set.getKey(); Object value = set.getValue(); - log.fine("Setting " + headName + " to " + value); + if (log.isLoggable(Level.FINE)) log.fine("Setting " + headName + " to " + value); String columnName = headName; diff --git a/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java b/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java index aa1436a58f..62e70632c5 100644 --- a/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java +++ b/org.adempiere.base/src/org/adempiere/util/AbstractDocumentSearch.java @@ -36,6 +36,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Properties; import java.util.Vector; +import java.util.logging.Level; import org.compiere.model.MColumn; import org.compiere.model.MQuery; @@ -67,7 +68,7 @@ public abstract class AbstractDocumentSearch { StringBuilder msglog = new StringBuilder(); msglog.append("Search started with String: ").append(searchString); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); // Check if / how many transaction-codes are used if (! Util.isEmpty(searchString)) { @@ -104,12 +105,12 @@ public abstract class AbstractDocumentSearch { msglog = new StringBuilder("Search with Transaction: '"); msglog.append(codeList.get(i)).append("' for: '") .append(search.toString()).append("'"); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); getID(codeList.get(i), search.toString()); } } else { msglog = new StringBuilder("Search without Transaction: ").append(search.toString()); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); getID(null, search.toString()); } } else { @@ -195,7 +196,7 @@ public abstract class AbstractDocumentSearch { } if (pstmtSO != null) { msglog = new StringBuilder("SQL Sales: ").append(sqlSO.toString()); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); rsSO = pstmtSO.executeQuery(); Vector idSO = new Vector(); while (rsSO.next()) { @@ -204,7 +205,7 @@ public abstract class AbstractDocumentSearch { if (role.getWindowAccess(msd.getAD_Window_ID()) != null) { msglog = new StringBuilder("Open Window: ").append(msd.getAD_Window_ID()).append(" / Table: ") .append(table.getTableName()).append(" / Number of Results: ").append(idSO.size()); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); if (idSO.size() == 0 && (searchString == null || searchString.trim().length() == 0)) { // No search string - open the window with new record @@ -218,7 +219,7 @@ public abstract class AbstractDocumentSearch { } if (pstmtPO != null) { msglog = new StringBuilder("SQL Purchase: ").append(sqlPO); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); rsPO = pstmtPO.executeQuery(); Vector idPO = new Vector(); while (rsPO.next()) { @@ -227,7 +228,7 @@ public abstract class AbstractDocumentSearch { if (role.getWindowAccess(msd.getPO_Window_ID()) != null) { msglog = new StringBuilder("Open Window: ").append(msd.getPO_Window_ID()).append(" / Table: ") .append(table.getTableName()).append(" / Number of Results: ").append(idPO.size()); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); openWindow(idPO, table.getTableName(), msd.getPO_Window_ID()); } else { log.warning("Role is not allowed to view this window"); @@ -287,7 +288,7 @@ public abstract class AbstractDocumentSearch { final MQuery query = new MQuery(tableName); if (whereString != null) { - log.fine(whereString.toString()); + if (log.isLoggable(Level.FINE)) log.fine(whereString.toString()); query.addRestriction(whereString.toString()); } final boolean ok = openWindow(windowId, query); diff --git a/org.adempiere.base/src/org/adempiere/util/LogAuthFailure.java b/org.adempiere.base/src/org/adempiere/util/LogAuthFailure.java index 0509fd0924..9623de84db 100644 --- a/org.adempiere.base/src/org/adempiere/util/LogAuthFailure.java +++ b/org.adempiere.base/src/org/adempiere/util/LogAuthFailure.java @@ -24,6 +24,7 @@ import java.io.OutputStreamWriter; import java.io.Writer; import java.sql.Timestamp; import java.text.SimpleDateFormat; +import java.util.logging.Level; import org.compiere.util.CLogger; import org.compiere.util.DisplayType; @@ -47,7 +48,7 @@ public class LogAuthFailure { file = new FileOutputStream(fileName, true); writer = new BufferedWriter(new OutputStreamWriter(file, "UTF8")); } catch (IOException e) { - log.fine(e.getMessage()); + if (log.isLoggable(Level.FINE)) log.fine(e.getMessage()); e.printStackTrace(); } } @@ -70,7 +71,7 @@ public class LogAuthFailure { writer.append("\n"); writer.flush(); } catch (Exception e) { - log.fine(e.getMessage()); + if (log.isLoggable(Level.FINE)) log.fine(e.getMessage()); } } diff --git a/org.adempiere.base/src/org/adempiere/util/ProcessUtil.java b/org.adempiere.base/src/org/adempiere/util/ProcessUtil.java index fabec25df4..f3cec3714f 100644 --- a/org.adempiere.base/src/org/adempiere/util/ProcessUtil.java +++ b/org.adempiere.base/src/org/adempiere/util/ProcessUtil.java @@ -308,7 +308,7 @@ public final class ProcessUtil { public static MWFProcess startWorkFlow(Properties ctx, ProcessInfo pi, int AD_Workflow_ID) { MWorkflow wf = MWorkflow.get (ctx, AD_Workflow_ID); MWFProcess wfProcess = wf.start(pi, pi.getTransactionName()); - log.fine(pi.toString()); + if (log.isLoggable(Level.FINE)) log.fine(pi.toString()); return wfProcess; } diff --git a/org.adempiere.base/src/org/compiere/acct/Doc.java b/org.adempiere.base/src/org/compiere/acct/Doc.java index 0b4e9fd6f3..ebf2d88c90 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc.java @@ -916,7 +916,7 @@ public abstract class Doc // boolean retValue = getBalance().signum() == 0; if (retValue) - log.fine("Yes " + toString()); + if (log.isLoggable(Level.FINE)) log.fine("Yes " + toString()); else log.warning("NO - " + toString()); return retValue; @@ -932,7 +932,7 @@ public abstract class Doc // No Currency in document if (getC_Currency_ID() == NO_CURRENCY) { - log.fine("(none) - " + toString()); + if (log.isLoggable(Level.FINE)) log.fine("(none) - " + toString()); return true; } // Journal from a different acct schema @@ -954,7 +954,7 @@ public abstract class Doc // just one and the same if (set.size() == 1 && acctSchema.getC_Currency_ID() == getC_Currency_ID()) { - log.fine("(same) Cur=" + getC_Currency_ID() + " - " + toString()); + if (log.isLoggable(Level.FINE)) log.fine("(same) Cur=" + getC_Currency_ID() + " - " + toString()); return true; } @@ -975,11 +975,11 @@ public abstract class Doc + " - " + toString()); } else - log.fine("From C_Currency_ID=" + C_Currency_ID); + if (log.isLoggable(Level.FINE)) log.fine("From C_Currency_ID=" + C_Currency_ID); } } - log.fine("Convertible=" + convertible + ", AcctSchema C_Currency_ID=" + acctSchema.getC_Currency_ID() + " - " + toString()); + if (log.isLoggable(Level.FINE)) log.fine("Convertible=" + convertible + ", AcctSchema C_Currency_ID=" + acctSchema.getC_Currency_ID() + " - " + toString()); return convertible; } // isConvertible @@ -1009,7 +1009,7 @@ public abstract class Doc else m_C_Period_ID = -1; // - log.fine( // + AD_Client_ID + " - " + if (log.isLoggable(Level.FINE)) log.fine( // + AD_Client_ID + " - " getDateAcct() + " - " + getDocumentType() + " => " + m_C_Period_ID); } // setC_Period_ID @@ -1033,7 +1033,7 @@ public abstract class Doc setPeriod(); boolean open = m_C_Period_ID > 0; if (open) - log.fine("Yes - " + toString()); + if (log.isLoggable(Level.FINE)) log.fine("Yes - " + toString()); else log.warning("NO - " + toString()); return open; diff --git a/org.adempiere.base/src/org/compiere/acct/DocLine.java b/org.adempiere.base/src/org/compiere/acct/DocLine.java index a28f11b81b..ac1cce333b 100644 --- a/org.adempiere.base/src/org/compiere/acct/DocLine.java +++ b/org.adempiere.base/src/org/compiere/acct/DocLine.java @@ -18,6 +18,7 @@ package org.compiere.acct; import java.math.BigDecimal; import java.sql.Timestamp; +import java.util.logging.Level; import org.compiere.model.MAccount; import org.compiere.model.MAcctSchema; @@ -978,7 +979,7 @@ public class DocLine String sql = "SELECT COALESCE(C_SalesRegion_ID,0) FROM C_BPartner_Location WHERE C_BPartner_Location_ID=?"; m_C_SalesRegion_ID = DB.getSQLValue (null, sql, getC_BPartner_Location_ID()); - log.fine("C_SalesRegion_ID=" + m_C_SalesRegion_ID + " (from BPL)" ); + if (log.isLoggable(Level.FINE)) log.fine("C_SalesRegion_ID=" + m_C_SalesRegion_ID + " (from BPL)" ); if (m_C_SalesRegion_ID == 0) m_C_SalesRegion_ID = -2; // don't try again } diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java index 73473c796d..77e474fb19 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java @@ -109,7 +109,7 @@ public class Doc_AllocationHdr extends Doc docLine.setC_ConversionType_ID(C_ConversionType_ID); } // - log.fine(docLine.toString()); + if (log.isLoggable(Level.FINE)) log.fine(docLine.toString()); list.add (docLine); } @@ -749,7 +749,7 @@ public class Doc_AllocationHdr extends Doc // StringBuilder description = new StringBuilder("Invoice=(").append(invoice.getC_Currency_ID()).append(")").append(invoiceSource).append("/").append(invoiceAccounted) .append(" - Allocation=(").append(getC_Currency_ID()).append(")").append(allocationSource).append("/").append(allocationAccounted); - log.fine(description.toString()); + if (log.isLoggable(Level.FINE)) log.fine(description.toString()); // Allocation not Invoice Currency if (getC_Currency_ID() != invoice.getC_Currency_ID()) { @@ -761,7 +761,7 @@ public class Doc_AllocationHdr extends Doc return "Gain/Loss - No Conversion from Allocation->Invoice"; StringBuilder d2 = new StringBuilder("Allocation=(").append(getC_Currency_ID()).append(")").append(allocationSource) .append("->(").append(invoice.getC_Currency_ID()).append(")").append(allocationSourceNew); - log.fine(d2.toString()); + if (log.isLoggable(Level.FINE)) log.fine(d2.toString()); description.append(" - ").append(d2); allocationSource = allocationSourceNew; } @@ -772,7 +772,7 @@ public class Doc_AllocationHdr extends Doc { acctDifference = invoiceAccounted.subtract(allocationAccounted); // gain is negative StringBuilder d2 = new StringBuilder("(full) = ").append(acctDifference); - log.fine(d2.toString()); + if (log.isLoggable(Level.FINE)) log.fine(d2.toString()); description.append(" - ").append(d2); } else // partial or MC @@ -791,7 +791,7 @@ public class Doc_AllocationHdr extends Doc if (acctDifference.scale() > precision) acctDifference = acctDifference.setScale(precision, BigDecimal.ROUND_HALF_UP); StringBuilder d2 = new StringBuilder("(partial) = ").append(acctDifference).append(" - Multiplier=").append(multiplier); - log.fine(d2.toString()); + if (log.isLoggable(Level.FINE)) log.fine(d2.toString()); description.append(" - ").append(d2); } @@ -1092,7 +1092,7 @@ class Doc_AllocationTax */ private BigDecimal calcAmount (BigDecimal tax, BigDecimal total, BigDecimal amt, int precision) { - log.fine("Amt=" + amt + " - Total=" + total + ", Tax=" + tax); + if (log.isLoggable(Level.FINE)) log.fine("Amt=" + amt + " - Total=" + total + ", Tax=" + tax); if (tax.signum() == 0 || total.signum() == 0 || amt.signum() == 0) @@ -1102,7 +1102,7 @@ class Doc_AllocationTax BigDecimal retValue = multiplier.multiply(amt); if (retValue.scale() > precision) retValue = retValue.setScale(precision, BigDecimal.ROUND_HALF_UP); - log.fine(retValue + " (Mult=" + multiplier + "(Prec=" + precision + ")"); + if (log.isLoggable(Level.FINE)) log.fine(retValue + " (Mult=" + multiplier + "(Prec=" + precision + ")"); return retValue; } // calcAmount diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_BankStatement.java b/org.adempiere.base/src/org/compiere/acct/Doc_BankStatement.java index 706ce4b728..ef8f147a95 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_BankStatement.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_BankStatement.java @@ -19,6 +19,7 @@ package org.compiere.acct; import java.math.BigDecimal; import java.sql.ResultSet; import java.util.ArrayList; +import java.util.logging.Level; import org.compiere.model.MAccount; import org.compiere.model.MAcctSchema; @@ -79,7 +80,7 @@ public class Doc_BankStatement extends Doc // Contained Objects p_lines = loadLines(bs); - log.fine("Lines=" + p_lines.length); + if (log.isLoggable(Level.FINE)) log.fine("Lines=" + p_lines.length); return null; } // loadDocumentDetails @@ -132,7 +133,7 @@ public class Doc_BankStatement extends Doc } sb.append("]"); // - log.fine(toString() + " Balance=" + retValue + sb.toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString() + " Balance=" + retValue + sb.toString()); return retValue; } // getBalance diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Cash.java b/org.adempiere.base/src/org/compiere/acct/Doc_Cash.java index 4c6e36f6cd..c90bf0d937 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Cash.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Cash.java @@ -68,7 +68,7 @@ public class Doc_Cash extends Doc // Contained Objects p_lines = loadLines(cash, cb); - log.fine("Lines=" + p_lines.length); + if (log.isLoggable(Level.FINE)) log.fine("Lines=" + p_lines.length); return null; } // loadDocumentDetails @@ -117,7 +117,7 @@ public class Doc_Cash extends Doc } sb.append("]"); // - log.fine(toString() + " Balance=" + retValue + sb.toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString() + " Balance=" + retValue + sb.toString()); // return retValue; return Env.ZERO; // Lines are balanced } // getBalance diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_GLJournal.java b/org.adempiere.base/src/org/compiere/acct/Doc_GLJournal.java index 1c6318eba3..902d4cfd16 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_GLJournal.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_GLJournal.java @@ -65,7 +65,7 @@ public class Doc_GLJournal extends Doc // Contained Objects p_lines = loadLines(journal); - log.fine("Lines=" + p_lines.length); + if (log.isLoggable(Level.FINE)) log.fine("Lines=" + p_lines.length); return null; } // loadDocumentDetails @@ -117,7 +117,7 @@ public class Doc_GLJournal extends Doc } sb.append("]"); // - log.fine(toString() + " Balance=" + retValue + sb.toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString() + " Balance=" + retValue + sb.toString()); return retValue; } // getBalance diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java b/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java index 53b2c8d381..f74460caf1 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java @@ -76,7 +76,7 @@ public class Doc_InOut extends Doc m_DocStatus = inout.getDocStatus(); // Contained Objects p_lines = loadLines(inout); - log.fine("Lines=" + p_lines.length); + if (log.isLoggable(Level.FINE)) log.fine("Lines=" + p_lines.length); return null; } // loadDocumentDetails @@ -110,7 +110,7 @@ public class Doc_InOut extends Doc int PP_Cost_Collector_ID = DB.getSQLValueEx(getTrxName(), sql, new Object[]{line.getC_OrderLine_ID()}); docLine.setPP_Cost_Collector_ID(PP_Cost_Collector_ID); // - log.fine(docLine.toString()); + if (log.isLoggable(Level.FINE)) log.fine(docLine.toString()); list.add (docLine); } @@ -410,7 +410,7 @@ public class Doc_InOut extends Doc { int stdPrecision = MCurrency.getStdPrecision(getCtx(), C_Currency_ID); BigDecimal costTax = tax.calculateTax(costs, true, stdPrecision); - log.fine("Costs=" + costs + " - Tax=" + costTax); + if (log.isLoggable(Level.FINE)) log.fine("Costs=" + costs + " - Tax=" + costTax); costs = costs.subtract(costTax); } } // correct included Tax diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java b/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java index 88417492d6..1f67aabd87 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Inventory.java @@ -19,6 +19,7 @@ package org.compiere.acct; import java.math.BigDecimal; import java.sql.ResultSet; import java.util.ArrayList; +import java.util.logging.Level; import org.compiere.model.MAccount; import org.compiere.model.MAcctSchema; @@ -72,7 +73,7 @@ public class Doc_Inventory extends Doc m_DocStatus = inventory.getDocStatus(); // Contained Objects p_lines = loadLines(inventory); - log.fine("Lines=" + p_lines.length); + if (log.isLoggable(Level.FINE)) log.fine("Lines=" + p_lines.length); return null; } // loadDocumentDetails @@ -105,7 +106,7 @@ public class Doc_Inventory extends Doc } docLine.setQty (Qty, false); // -5 => -5 docLine.setReversalLine_ID(line.getReversalLine_ID()); - log.fine(docLine.toString()); + if (log.isLoggable(Level.FINE)) log.fine(docLine.toString()); list.add (docLine); } diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java b/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java index f5e6084051..8021c57e02 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Invoice.java @@ -88,7 +88,7 @@ public class Doc_Invoice extends Doc // Contained Objects m_taxes = loadTaxes(); p_lines = loadLines(invoice); - log.fine("Lines=" + p_lines.length + ", Taxes=" + m_taxes.length); + if (log.isLoggable(Level.FINE)) log.fine("Lines=" + p_lines.length + ", Taxes=" + m_taxes.length); return null; } // loadDocumentDetails @@ -121,7 +121,7 @@ public class Doc_Invoice extends Doc // DocTax taxLine = new DocTax(C_Tax_ID, name, rate, taxBaseAmt, amount, salesTax); - log.fine(taxLine.toString()); + if (log.isLoggable(Level.FINE)) log.fine(taxLine.toString()); list.add(taxLine); } } @@ -173,7 +173,7 @@ public class Doc_Invoice extends Doc if (!tax.isZeroTax()) { BigDecimal LineNetAmtTax = tax.calculateTax(LineNetAmt, true, getStdPrecision()); - log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax); + if (log.isLoggable(Level.FINE)) log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax); LineNetAmt = LineNetAmt.subtract(LineNetAmtTax); for (int t = 0; t < m_taxes.length; t++) { @@ -194,7 +194,7 @@ public class Doc_Invoice extends Doc else m_allLinesItem = false; // - log.fine(docLine.toString()); + if (log.isLoggable(Level.FINE)) log.fine(docLine.toString()); list.add(docLine); } @@ -266,7 +266,7 @@ public class Doc_Invoice extends Doc } sb.append("]"); // - log.fine(toString() + " Balance=" + retValue + sb.toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString() + " Balance=" + retValue + sb.toString()); return retValue; } // getBalance @@ -914,7 +914,7 @@ public class Doc_Invoice extends Doc .append(" AND po.M_Product_ID=il.M_Product_ID AND po.C_BPartner_ID=i.C_BPartner_ID") .append(" AND i.C_Invoice_ID=").append(get_ID()).append(")"); int no = DB.executeUpdate(sql.toString(), getTrxName()); - log.fine("Updated=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Updated=" + no); } // updateProductPO } // Doc_Invoice diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java b/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java index 7c96be0ff6..cff6ff0c50 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_MatchInv.java @@ -19,6 +19,7 @@ package org.compiere.acct; import java.math.BigDecimal; import java.sql.ResultSet; import java.util.ArrayList; +import java.util.logging.Level; import org.compiere.model.MAccount; import org.compiere.model.MAcctSchema; @@ -131,7 +132,7 @@ public class Doc_MatchInv extends Doc || getQty().signum() == 0 || m_receiptLine.getMovementQty().signum() == 0) // Qty = 0 { - log.fine("No Product/Qty - M_Product_ID=" + getM_Product_ID() + if (log.isLoggable(Level.FINE)) log.fine("No Product/Qty - M_Product_ID=" + getM_Product_ID() + ",Qty=" + getQty() + ",InOutQty=" + m_receiptLine.getMovementQty()); return facts; } @@ -178,7 +179,7 @@ public class Doc_MatchInv extends Doc p_Error = "Mat.Receipt not posted yet"; return null; } - log.fine("CR - Amt(" + temp + "->" + dr.getAcctBalance() + if (log.isLoggable(Level.FINE)) log.fine("CR - Amt(" + temp + "->" + dr.getAcctBalance() + ") - " + dr.toString()); // InventoryClearing CR @@ -201,7 +202,7 @@ public class Doc_MatchInv extends Doc as.getC_Currency_ID(), null, LineNetAmt); // updated below if (cr == null) { - log.fine("Line Net Amt=0 - M_Product_ID=" + getM_Product_ID() + if (log.isLoggable(Level.FINE)) log.fine("Line Net Amt=0 - M_Product_ID=" + getM_Product_ID() + ",Qty=" + getQty() + ",InOutQty=" + m_receiptLine.getMovementQty()); // Invoice Price Variance @@ -222,7 +223,7 @@ public class Doc_MatchInv extends Doc pv.setUser1_ID(m_invoiceLine.getUser1_ID()); pv.setUser2_ID(m_invoiceLine.getUser2_ID()); } - log.fine("IPV=" + ipv + "; Balance=" + fact.getSourceBalance()); + if (log.isLoggable(Level.FINE)) log.fine("IPV=" + ipv + "; Balance=" + fact.getSourceBalance()); facts.add(fact); return facts; } @@ -235,7 +236,7 @@ public class Doc_MatchInv extends Doc p_Error = "Invoice not posted yet"; return null; } - log.fine("DR - Amt(" + temp + "->" + cr.getAcctBalance() + if (log.isLoggable(Level.FINE)) log.fine("DR - Amt(" + temp + "->" + cr.getAcctBalance() + ") - " + cr.toString()); } else // Cash Acct @@ -303,7 +304,7 @@ public class Doc_MatchInv extends Doc pv.setUser1_ID(m_invoiceLine.getUser1_ID()); pv.setUser2_ID(m_invoiceLine.getUser2_ID()); } - log.fine("IPV=" + ipv + "; Balance=" + fact.getSourceBalance()); + if (log.isLoggable(Level.FINE)) log.fine("IPV=" + ipv + "; Balance=" + fact.getSourceBalance()); String error = createMatchInvCostDetail(as); if (error != null && error.trim().length() > 0) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java b/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java index 33d644db91..ed3d8b8355 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java @@ -129,7 +129,7 @@ public class Doc_MatchPO extends Doc || getQty().signum() == 0 || m_M_InOutLine_ID == 0) // No posting if not matched to Shipment { - log.fine("No Product/Qty - M_Product_ID=" + getM_Product_ID() + if (log.isLoggable(Level.FINE)) log.fine("No Product/Qty - M_Product_ID=" + getM_Product_ID() + ",Qty=" + getQty()); return facts; } @@ -311,7 +311,7 @@ public class Doc_MatchPO extends Doc { int stdPrecision = MCurrency.getStdPrecision(getCtx(), m_oLine.getC_Currency_ID()); BigDecimal costTax = tax.calculateTax(poCost, true, stdPrecision); - log.fine("Costs=" + poCost + " - Tax=" + costTax); + if (log.isLoggable(Level.FINE)) log.fine("Costs=" + poCost + " - Tax=" + costTax); poCost = poCost.subtract(costTax); } } // correct included Tax diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Movement.java b/org.adempiere.base/src/org/compiere/acct/Doc_Movement.java index 3ee984284e..039ebf82a9 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Movement.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Movement.java @@ -19,6 +19,7 @@ package org.compiere.acct; import java.math.BigDecimal; import java.sql.ResultSet; import java.util.ArrayList; +import java.util.logging.Level; import org.compiere.model.MAcctSchema; import org.compiere.model.MCostDetail; @@ -69,7 +70,7 @@ public class Doc_Movement extends Doc m_DocStatus = move.getDocStatus(); // Contained Objects p_lines = loadLines(move); - log.fine("Lines=" + p_lines.length); + if (log.isLoggable(Level.FINE)) log.fine("Lines=" + p_lines.length); return null; } // loadDocumentDetails @@ -88,7 +89,7 @@ public class Doc_Movement extends Doc DocLine docLine = new DocLine (line, this); docLine.setQty(line.getMovementQty(), false); docLine.setReversalLine_ID(line.getReversalLine_ID()); - log.fine(docLine.toString()); + if (log.isLoggable(Level.FINE)) log.fine(docLine.toString()); list.add (docLine); } 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 0fa93b74ce..63ad382edb 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Order.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Order.java @@ -121,7 +121,7 @@ public class Doc_Order extends Doc if (!tax.isZeroTax()) { BigDecimal LineNetAmtTax = tax.calculateTax(LineNetAmt, true, getStdPrecision()); - log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax); + if (log.isLoggable(Level.FINE)) log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax); LineNetAmt = LineNetAmt.subtract(LineNetAmtTax); for (int t = 0; t < m_taxes.length; t++) { @@ -311,11 +311,11 @@ public class Doc_Order extends Doc if (retValue.signum() != 0 // Sum of Cost(vs. Price) in lines may not add up && getDocumentType().equals(DOCTYPE_POrder)) // PO { - log.fine(toString() + " Balance=" + retValue + sb.toString() + " (ignored)"); + if (log.isLoggable(Level.FINE)) log.fine(toString() + " Balance=" + retValue + sb.toString() + " (ignored)"); retValue = Env.ZERO; } else - log.fine(toString() + " Balance=" + retValue + sb.toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString() + " Balance=" + retValue + sb.toString()); return retValue; } // getBalance @@ -486,7 +486,7 @@ public class Doc_Order extends Doc .append(" AND po.M_Product_ID=ol.M_Product_ID AND po.C_BPartner_ID=o.C_BPartner_ID") .append(" AND o.C_Order_ID=").append(get_ID()).append(")"); int no = DB.executeUpdate(sql.toString(), getTrxName()); - log.fine("Updated=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Updated=" + no); } // updateProductPO diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_Production.java b/org.adempiere.base/src/org/compiere/acct/Doc_Production.java index 8931f8ef0a..febaad86f8 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_Production.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_Production.java @@ -66,7 +66,7 @@ public class Doc_Production extends Doc setDateAcct(prod.getMovementDate()); // Contained Objects p_lines = loadLines(prod); - log.fine("Lines=" + p_lines.length); + if (log.isLoggable(Level.FINE)) log.fine("Lines=" + p_lines.length); return null; } // loadDocumentDetails @@ -103,7 +103,7 @@ public class Doc_Production extends Doc // Identify finished BOM Product docLine.setProductionBOM(line.getM_Product_ID() == prod.getM_Product_ID()); // - log.fine(docLine.toString()); + if (log.isLoggable(Level.FINE)) log.fine(docLine.toString()); list.add (docLine); } } diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java b/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java index 11ce108a20..31752cda01 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_ProjectIssue.java @@ -75,7 +75,7 @@ public class Doc_ProjectIssue extends Doc // Pseudo Line Check if (m_line.getM_Product_ID() == 0) log.warning(m_line.toString() + " - No Product"); - log.fine(m_line.toString()); + if (log.isLoggable(Level.FINE)) log.fine(m_line.toString()); return null; } // loadDocumentDetails @@ -189,7 +189,7 @@ public class Doc_ProjectIssue extends Doc if (rs.next()) { retValue = rs.getBigDecimal(1); - log.fine("POCost = " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("POCost = " + retValue); } else log.warning("Not found for M_InOutLine_ID=" + m_issue.getM_InOutLine_ID()); @@ -232,7 +232,7 @@ public class Doc_ProjectIssue extends Doc retValue = rs.getBigDecimal(1); qty = rs.getBigDecimal(2); retValue = retValue.multiply(qty); - log.fine("ExpLineCost = " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("ExpLineCost = " + retValue); } else log.warning("Not found for S_TimeExpenseLine_ID=" + m_issue.getS_TimeExpenseLine_ID()); diff --git a/org.adempiere.base/src/org/compiere/acct/Fact.java b/org.adempiere.base/src/org/compiere/acct/Fact.java index 14d5d196b1..2f943e56f7 100644 --- a/org.adempiere.base/src/org/compiere/acct/Fact.java +++ b/org.adempiere.base/src/org/compiere/acct/Fact.java @@ -137,11 +137,11 @@ public final class Fact { if (docLine == null || docLine.getQty() == null || docLine.getQty().signum() == 0) { - log.fine("Both amounts & qty = 0/Null - " + docLine + if (log.isLoggable(Level.FINE)) log.fine("Both amounts & qty = 0/Null - " + docLine + " - " + toString()); return null; } - log.fine("Both amounts = 0/Null, Qty=" + docLine.getQty() + " - " + docLine + if (log.isLoggable(Level.FINE)) log.fine("Both amounts = 0/Null, Qty=" + docLine.getQty() + " - " + docLine + " - " + toString()); } // Convert @@ -151,7 +151,7 @@ public final class Fact && (docLine.getAmtAcctDr() != null || docLine.getAmtAcctCr() != null)) line.setAmtAcct(docLine.getAmtAcctDr(), docLine.getAmtAcctCr()); // - log.fine(line.toString()); + if (log.isLoggable(Level.FINE)) log.fine(line.toString()); add(line); return line; } // createLine @@ -310,7 +310,7 @@ public final class Fact // Convert line.convert(); // - log.fine(line.toString()); + if (log.isLoggable(Level.FINE)) log.fine(line.toString()); m_lines.add(line); return line; } // balancingSource @@ -412,7 +412,7 @@ public final class Fact if (m_lines.size() == 0) return; - log.fine ("(" + elementType + ") - " + toString()); + if (log.isLoggable(Level.FINE)) log.fine ("(" + elementType + ") - " + toString()); // Org if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_Organization)) @@ -481,7 +481,7 @@ public final class Fact line.setAD_Org_ID(key.intValue()); // m_lines.add(line); - log.fine("(" + elementType + ") - " + line); + if (log.isLoggable(Level.FINE)) log.fine("(" + elementType + ") - " + line); } } map.clear(); @@ -536,7 +536,7 @@ public final class Fact public FactLine balanceAccounting() { BigDecimal diff = getAcctBalance(); // DR-CR - log.fine("Balance=" + diff + if (log.isLoggable(Level.FINE)) log.fine("Balance=" + diff + ", CurrBal=" + m_acctSchema.isCurrencyBalancing() + " - " + toString()); FactLine line = null; @@ -598,7 +598,7 @@ public final class Fact drAmt = difference.negate(); } line.setAmtAcct(drAmt, crAmt); - log.fine(line.toString()); + if (log.isLoggable(Level.FINE)) log.fine(line.toString()); m_lines.add(line); } else // Adjust biggest (Balance Sheet) line amount @@ -611,9 +611,9 @@ public final class Fact log.severe ("No Line found"); else { - log.fine("Adjusting Amt=" + diff + "; Line=" + line); + if (log.isLoggable(Level.FINE)) log.fine("Adjusting Amt=" + diff + "; Line=" + line); line.currencyCorrect(diff); - log.fine(line.toString()); + if (log.isLoggable(Level.FINE)) log.fine(line.toString()); } } // correct biggest amount diff --git a/org.adempiere.base/src/org/compiere/acct/FactLine.java b/org.adempiere.base/src/org/compiere/acct/FactLine.java index 6b53664fd0..f7a50dcba8 100644 --- a/org.adempiere.base/src/org/compiere/acct/FactLine.java +++ b/org.adempiere.base/src/org/compiere/acct/FactLine.java @@ -653,7 +653,7 @@ public final class FactLine extends X_Fact_Acct boolean negative = deltaAmount.compareTo(Env.ZERO) < 0; boolean adjustDr = getAmtAcctDr().abs().compareTo(getAmtAcctCr().abs()) > 0; - log.fine(deltaAmount.toString() + if (log.isLoggable(Level.FINE)) log.fine(deltaAmount.toString() + "; Old-AcctDr=" + getAmtAcctDr() + ",AcctCr=" + getAmtAcctCr() + "; Negative=" + negative + "; AdjustDr=" + adjustDr); @@ -668,7 +668,7 @@ public final class FactLine extends X_Fact_Acct else setAmtAcctCr (getAmtAcctCr().add(deltaAmount)); - log.fine("New-AcctDr=" + getAmtAcctDr() + ",AcctCr=" + getAmtAcctCr()); + if (log.isLoggable(Level.FINE)) log.fine("New-AcctDr=" + getAmtAcctDr() + ",AcctCr=" + getAmtAcctCr()); } // currencyCorrect /** @@ -859,7 +859,7 @@ public final class FactLine extends X_Fact_Acct if (super.getC_SalesRegion_ID() != 0) // save in VO { m_doc.setBP_C_SalesRegion_ID(super.getC_SalesRegion_ID()); - log.fine("C_SalesRegion_ID=" + super.getC_SalesRegion_ID() + " (from BPL)" ); + if (log.isLoggable(Level.FINE)) log.fine("C_SalesRegion_ID=" + super.getC_SalesRegion_ID() + " (from BPL)" ); } else // From Sales Rep of Document -> Sales Region { @@ -869,7 +869,7 @@ public final class FactLine extends X_Fact_Acct if (super.getC_SalesRegion_ID() != 0) // save in VO { m_doc.setBP_C_SalesRegion_ID(super.getC_SalesRegion_ID()); - log.fine("C_SalesRegion_ID=" + super.getC_SalesRegion_ID() + " (from SR)" ); + if (log.isLoggable(Level.FINE)) log.fine("C_SalesRegion_ID=" + super.getC_SalesRegion_ID() + " (from SR)" ); } else m_doc.setBP_C_SalesRegion_ID(-2); // don't try again @@ -896,7 +896,7 @@ public final class FactLine extends X_Fact_Acct { if (newRecord) { - log.fine(toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString()); // getAD_Org_ID(); getC_SalesRegion_ID(); @@ -985,7 +985,7 @@ public final class FactLine extends X_Fact_Acct int C_Campaign_ID, int C_Activity_ID, int User1_ID, int User2_ID, int UserElement1_ID, int UserElement2_ID) { - log.fine("From Accout_ID=" + Account_ID); + if (log.isLoggable(Level.FINE)) log.fine("From Accout_ID=" + Account_ID); // get VC for P_Revenue (from Product) MAccount revenue = MAccount.get(getCtx(), AD_Client_ID, AD_Org_ID, getC_AcctSchema_ID(), Account_ID, C_SubAcct_ID, @@ -1050,7 +1050,7 @@ public final class FactLine extends X_Fact_Acct log.severe ("Plan NOT created"); return Account_ID; } - log.fine("From Acctount_ID=" + Account_ID + " to " + new_Account_ID + if (log.isLoggable(Level.FINE)) log.fine("From Acctount_ID=" + Account_ID + " to " + new_Account_ID + " - Plan from UnearnedRevenue_Acct=" + UnearnedRevenue_Acct + " to Revenue_Acct=" + P_Revenue_Acct); return new_Account_ID; } // createRevenueRecognition @@ -1114,7 +1114,7 @@ public final class FactLine extends X_Fact_Acct // end Bayu Sistematika // success = true; - log.fine(new StringBuilder("(Table=").append(AD_Table_ID) + if (log.isLoggable(Level.FINE)) log.fine(new StringBuilder("(Table=").append(AD_Table_ID) .append(",Record_ID=").append(Record_ID) .append(",Line=").append(Record_ID) .append(", Account=").append(m_acct) diff --git a/org.adempiere.base/src/org/compiere/acct/Matcher.java b/org.adempiere.base/src/org/compiere/acct/Matcher.java index dd1245e57d..f507f6a51a 100644 --- a/org.adempiere.base/src/org/compiere/acct/Matcher.java +++ b/org.adempiere.base/src/org/compiere/acct/Matcher.java @@ -132,7 +132,7 @@ public class Matcher DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("Matcher.match - Client_ID=" + m_AD_Client_ID + if (log.isLoggable(Level.FINE)) log.fine("Matcher.match - Client_ID=" + m_AD_Client_ID + ", Records created=" + counter); return counter; } // match @@ -152,7 +152,7 @@ public class Matcher int M_InOutLine_ID, int C_InvoiceLine_ID, int M_Product_ID, Timestamp DateTrx, BigDecimal Qty) { - log.fine("InvLine=" + C_InvoiceLine_ID + ",Rec=" + M_InOutLine_ID + ", Qty=" + Qty + ", " + DateTrx); + if (log.isLoggable(Level.FINE)) log.fine("InvLine=" + C_InvoiceLine_ID + ",Rec=" + M_InOutLine_ID + ", Qty=" + Qty + ", " + DateTrx); // MMatchInv inv = new MMatchInv (); int M_MatchInv_ID = DB.getNextID (AD_Client_ID, "M_MatchInv", m_trxName); diff --git a/org.adempiere.base/src/org/compiere/cm/WebProjectDeploy.java b/org.adempiere.base/src/org/compiere/cm/WebProjectDeploy.java index 10facdb1bc..b7aee9aa88 100644 --- a/org.adempiere.base/src/org/compiere/cm/WebProjectDeploy.java +++ b/org.adempiere.base/src/org/compiere/cm/WebProjectDeploy.java @@ -110,7 +110,7 @@ public class WebProjectDeploy extends SvrProcess { String name = container.getName(); if (container.delete(true)) - log.fine("Deleted: " + name); + if (log.isLoggable(Level.FINE)) log.fine("Deleted: " + name); else // e.g. was referenced { log.warning("Failed Delete: " + name); diff --git a/org.adempiere.base/src/org/compiere/db/CConnection.java b/org.adempiere.base/src/org/compiere/db/CConnection.java index 197df7f7cd..fe7ea9ade7 100644 --- a/org.adempiere.base/src/org/compiere/db/CConnection.java +++ b/org.adempiere.base/src/org/compiere/db/CConnection.java @@ -98,7 +98,7 @@ public class CConnection implements Serializable, Cloneable s_cc = new CConnection (null); s_cc.setAttributes (attributes); } - log.fine(s_cc.toString()); + if (log.isLoggable(Level.FINE)) log.fine(s_cc.toString()); } return s_cc; diff --git a/org.adempiere.base/src/org/compiere/db/StatementProxy.java b/org.adempiere.base/src/org/compiere/db/StatementProxy.java index 1a1cc5a7cc..f3cc7af0e9 100644 --- a/org.adempiere.base/src/org/compiere/db/StatementProxy.java +++ b/org.adempiere.base/src/org/compiere/db/StatementProxy.java @@ -115,7 +115,7 @@ public class StatementProxy implements InvocationHandler { } if (logOperation != null) { logSql = logSql.substring(0, logSql.indexOf(' ')); - log.fine((DisplayType.getDateFormat(DisplayType.DateTime)).format(new Date(System.currentTimeMillis()))+","+logOperation+","+logSql+","+(p_vo.getTrxName() != null ? p_vo.getTrxName() : "")+" (begin)"); + if (log.isLoggable(Level.FINE)) log.fine((DisplayType.getDateFormat(DisplayType.DateTime)).format(new Date(System.currentTimeMillis()))+","+logOperation+","+logSql+","+(p_vo.getTrxName() != null ? p_vo.getTrxName() : "")+" (begin)"); } } } diff --git a/org.adempiere.base/src/org/compiere/dbPort/Convert.java b/org.adempiere.base/src/org/compiere/dbPort/Convert.java index 91f9d23d6b..11069502c2 100644 --- a/org.adempiere.base/src/org/compiere/dbPort/Convert.java +++ b/org.adempiere.base/src/org/compiere/dbPort/Convert.java @@ -148,7 +148,7 @@ public abstract class Convert } } if (m_verbose) - log.fine("- ok " + no); + if (log.isLoggable(Level.FINE)) log.fine("- ok " + no); } catch (SQLException ex) { diff --git a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java index b9dc578241..6ab5159777 100644 --- a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java +++ b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java @@ -414,7 +414,7 @@ public final class ImpFormat list.add(entry.toString()); // if (trace) - log.fine(info + "=>" + entry.toString() + " (Length=" + info.length() + ")"); + if (log.isLoggable(Level.FINE)) log.fine(info + "=>" + entry.toString() + " (Length=" + info.length() + ")"); } // for all columns String[] retValue = new String[list.size()]; diff --git a/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java b/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java index 9b11a5b45b..f1c8cbb8e0 100644 --- a/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java +++ b/org.adempiere.base/src/org/compiere/model/AccessSqlParser.java @@ -20,7 +20,6 @@ import java.util.ArrayList; import java.util.StringTokenizer; import java.util.logging.Level; -import org.compiere.util.CLogMgt; import org.compiere.util.CLogger; /** @@ -117,8 +116,7 @@ public class AccessSqlParser m_tableInfo.add(info); } // - if (CLogMgt.isLevelFinest()) - log.fine(toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString()); return m_tableInfo.size() > 0; } // parse diff --git a/org.adempiere.base/src/org/compiere/model/ArchiveDB.java b/org.adempiere.base/src/org/compiere/model/ArchiveDB.java index 56b45b3234..a55ceae167 100644 --- a/org.adempiere.base/src/org/compiere/model/ArchiveDB.java +++ b/org.adempiere.base/src/org/compiere/model/ArchiveDB.java @@ -41,7 +41,7 @@ public class ArchiveDB implements IArchiveStore { if (deflatedData == null) return null; // - log.fine("ZipSize=" + deflatedData.length); + if (log.isLoggable(Level.FINE)) log.fine("ZipSize=" + deflatedData.length); if (deflatedData.length == 0) return null; @@ -61,7 +61,7 @@ public class ArchiveDB implements IArchiveStore { } // inflatedData = out.toByteArray(); - log.fine("Size=" + inflatedData.length + " - zip=" + entry.getCompressedSize() + if (log.isLoggable(Level.FINE)) log.fine("Size=" + inflatedData.length + " - zip=" + entry.getCompressedSize() + "(" + entry.getSize() + ") " + (entry.getCompressedSize() * 100 / entry.getSize()) + "%"); } @@ -93,13 +93,13 @@ public class ArchiveDB implements IArchiveStore { zip.putNextEntry(entry); zip.write(inflatedData, 0, inflatedData.length); zip.closeEntry(); - log.fine(entry.getCompressedSize() + " (" + entry.getSize() + ") " + if (log.isLoggable(Level.FINE)) log.fine(entry.getCompressedSize() + " (" + entry.getSize() + ") " + (entry.getCompressedSize() * 100 / entry.getSize()) + "%"); // // zip.finish(); zip.close(); deflatedData = out.toByteArray(); - log.fine("Length=" + inflatedData.length); + if (log.isLoggable(Level.FINE)) log.fine("Length=" + inflatedData.length); } catch (Exception e) { log.log(Level.SEVERE, "saveLOBData", e); deflatedData = null; diff --git a/org.adempiere.base/src/org/compiere/model/ArchiveFileSystem.java b/org.adempiere.base/src/org/compiere/model/ArchiveFileSystem.java index 172a1353dc..07dd848e90 100644 --- a/org.adempiere.base/src/org/compiere/model/ArchiveFileSystem.java +++ b/org.adempiere.base/src/org/compiere/model/ArchiveFileSystem.java @@ -85,7 +85,7 @@ public class ArchiveFileSystem implements IArchiveStore { return null; } String filePath = fileNode.getNodeValue(); - log.fine("filePath: " + filePath); + if (log.isLoggable(Level.FINE)) log.fine("filePath: " + filePath); if(filePath!=null){ filePath = filePath.replaceFirst(ARCHIVE_FOLDER_PLACEHOLDER, archivePathRoot.replaceAll("\\\\","\\\\\\\\")); //just to be shure... @@ -96,7 +96,7 @@ public class ArchiveFileSystem implements IArchiveStore { filePath = filePath.replaceAll("/", replaceSeparator); filePath = filePath.replaceAll("\\\\", replaceSeparator); } - log.fine("filePath: " + filePath); + if (log.isLoggable(Level.FINE)) log.fine("filePath: " + filePath); final File file = new File(filePath); if (file.exists()) { // read files into byte[] @@ -196,7 +196,7 @@ public class ArchiveFileSystem implements IArchiveStore { final Transformer xformer = TransformerFactory.newInstance().newTransformer(); xformer.transform(source, result); final byte[] xmlData = bos.toByteArray(); - log.fine(bos.toString()); + if (log.isLoggable(Level.FINE)) log.fine(bos.toString()); //store xml in db archive.setByteData(xmlData); diff --git a/org.adempiere.base/src/org/compiere/model/AttachmentDBSystem.java b/org.adempiere.base/src/org/compiere/model/AttachmentDBSystem.java index 31426df03c..d0abc43b73 100644 --- a/org.adempiere.base/src/org/compiere/model/AttachmentDBSystem.java +++ b/org.adempiere.base/src/org/compiere/model/AttachmentDBSystem.java @@ -41,7 +41,7 @@ public class AttachmentDBSystem implements IAttachmentStore byte[] data = attach.getBinaryData(); if (data == null) return true; - log.fine("ZipSize=" + data.length); + if (log.isLoggable(Level.FINE)) log.fine("ZipSize=" + data.length); if (data.length == 0) return true; @@ -70,7 +70,7 @@ public class AttachmentDBSystem implements IAttachmentStore } // byte[] dataEntry = out.toByteArray(); - log.fine(name + if (log.isLoggable(Level.FINE)) log.fine(name + " - size=" + dataEntry.length + " - zip=" + entry.getCompressedSize() + "(" + entry.getSize() + ") " + (entry.getCompressedSize()*100/entry.getSize())+ "%"); @@ -113,14 +113,14 @@ public class AttachmentDBSystem implements IAttachmentStore byte[] data = item.getData(); zip.write (data, 0, data.length); zip.closeEntry(); - log.fine(entry.getName() + " - " + if (log.isLoggable(Level.FINE)) log.fine(entry.getName() + " - " + entry.getCompressedSize() + " (" + entry.getSize() + ") " + (entry.getCompressedSize()*100/entry.getSize())+ "%"); } // zip.finish(); zip.close(); byte[] zipData = out.toByteArray(); - log.fine("Length=" + zipData.length); + if (log.isLoggable(Level.FINE)) log.fine("Length=" + zipData.length); attach.setBinaryData(zipData); attach.setTitle(MAttachment.ZIP); return true; diff --git a/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java b/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java index d64800747c..0b06fae312 100644 --- a/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java +++ b/org.adempiere.base/src/org/compiere/model/AttachmentFileSystem.java @@ -67,13 +67,13 @@ public class AttachmentFileSystem implements IAttachmentStore { document.setXmlStandalone(true); // create xml entries for (int i = 0; i < attach.m_items.size(); i++) { - log.fine(attach.m_items.get(i).toString()); + if (log.isLoggable(Level.FINE)) log.fine(attach.m_items.get(i).toString()); File entryFile = attach.m_items.get(i).getFile(); final String path = entryFile.getAbsolutePath(); // if local file - copy to central attachment folder - log.fine(path + " - " + attachmentPathRoot); + if (log.isLoggable(Level.FINE)) log.fine(path + " - " + attachmentPathRoot); if (!path.startsWith(attachmentPathRoot)) { - log.fine("move file: " + path); + if (log.isLoggable(Level.FINE)) log.fine("move file: " + path); FileChannel in = null; FileChannel out = null; try { @@ -130,7 +130,7 @@ public class AttachmentFileSystem implements IAttachmentStore { final Transformer xformer = TransformerFactory.newInstance().newTransformer(); xformer.transform(source, result); final byte[] xmlData = bos.toByteArray(); - log.fine(bos.toString()); + if (log.isLoggable(Level.FINE)) log.fine(bos.toString()); attach.setBinaryData(xmlData); attach.setTitle(MAttachment.XML); return true; @@ -155,7 +155,7 @@ public class AttachmentFileSystem implements IAttachmentStore { byte[] data = attach.getBinaryData(); if (data == null) return true; - log.fine("TextFileSize=" + data.length); + if (log.isLoggable(Level.FINE)) log.fine("TextFileSize=" + data.length); if (data.length == 0) return true; @@ -175,9 +175,9 @@ public class AttachmentFileSystem implements IAttachmentStore { attach.m_items = null; return false; } - log.fine("name: " + nameNode.getNodeValue()); + if (log.isLoggable(Level.FINE)) log.fine("name: " + nameNode.getNodeValue()); String filePath = fileNode.getNodeValue(); - log.fine("filePath: " + filePath); + if (log.isLoggable(Level.FINE)) log.fine("filePath: " + filePath); if(filePath!=null){ filePath = filePath.replaceFirst(attach.ATTACHMENT_FOLDER_PLACEHOLDER, attachmentPathRoot.replaceAll("\\\\","\\\\\\\\")); //just to be shure... @@ -188,7 +188,7 @@ public class AttachmentFileSystem implements IAttachmentStore { filePath = filePath.replaceAll("/", replaceSeparator); filePath = filePath.replaceAll("\\\\", replaceSeparator); } - log.fine("filePath: " + filePath); + if (log.isLoggable(Level.FINE)) log.fine("filePath: " + filePath); final File file = new File(filePath); if (file.exists()) { // read files into byte[] @@ -273,7 +273,7 @@ public class AttachmentFileSystem implements IAttachmentStore { //remove files final MAttachmentEntry entry = attach.m_items.get(index); final File file = entry.getFile(); - log.fine("delete: " + file.getAbsolutePath()); + if (log.isLoggable(Level.FINE)) log.fine("delete: " + file.getAbsolutePath()); if (file != null && file.exists()) { if (!file.delete()) { log.warning("unable to delete " + file.getAbsolutePath()); diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java index 6b87f40d56..e94706c157 100644 --- a/org.adempiere.base/src/org/compiere/model/GridField.java +++ b/org.adempiere.base/src/org/compiere/model/GridField.java @@ -274,7 +274,7 @@ public class GridField if (m_lookup == null || m_lookup.getValidation().length() == 0) return true; // - log.fine("(" + m_vo.ColumnName + ")"); + if (log.isLoggable(Level.FINE)) log.fine("(" + m_vo.ColumnName + ")"); m_lookup.refresh(); return m_lookup.isValidated(); } // refreshLookup @@ -539,13 +539,13 @@ public class GridField && (m_vo.DefaultValue == null || m_vo.DefaultValue.length() == 0)) { String parent = Env.getContext(m_vo.ctx, m_vo.WindowNo, m_vo.ColumnName); - log.fine("[Parent] " + m_vo.ColumnName + "=" + parent); + if (log.isLoggable(Level.FINE)) log.fine("[Parent] " + m_vo.ColumnName + "=" + parent); return createDefault(parent); } // Always Active if (m_vo.ColumnName.equals("IsActive")) { - log.fine("[IsActive] " + m_vo.ColumnName + "=Y"); + if (log.isLoggable(Level.FINE)) log.fine("[IsActive] " + m_vo.ColumnName + "=Y"); return "Y"; } @@ -553,14 +553,14 @@ public class GridField if (X_AD_Table.ACCESSLEVEL_SystemOnly.equals(Env.getContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, GridTab.CTX_AccessLevel)) && (m_vo.ColumnName.equals("AD_Client_ID") || m_vo.ColumnName.equals("AD_Org_ID"))) { - log.fine("[SystemAccess] " + m_vo.ColumnName + "=0"); + if (log.isLoggable(Level.FINE)) log.fine("[SystemAccess] " + m_vo.ColumnName + "=0"); return new Integer(0); } // Set Org to System, if Client access else if (X_AD_Table.ACCESSLEVEL_SystemPlusClient.equals(Env.getContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, GridTab.CTX_AccessLevel)) && m_vo.ColumnName.equals("AD_Org_ID")) { - log.fine("[ClientAccess] " + m_vo.ColumnName + "=0"); + if (log.isLoggable(Level.FINE)) log.fine("[ClientAccess] " + m_vo.ColumnName + "=0"); return new Integer(0); } @@ -605,7 +605,7 @@ public class GridField } if (defStr != null && defStr.length() > 0) { - log.fine("[SQL] " + m_vo.ColumnName + "=" + defStr); + if (log.isLoggable(Level.FINE)) log.fine("[SQL] " + m_vo.ColumnName + "=" + defStr); return createDefault(defStr); } } // SQL Statement @@ -630,7 +630,7 @@ public class GridField if (!defStr.equals("")) { - log.fine("[DefaultValue] " + m_vo.ColumnName + "=" + defStr); + if (log.isLoggable(Level.FINE)) log.fine("[DefaultValue] " + m_vo.ColumnName + "=" + defStr); return createDefault(defStr); } } // while more Tokens @@ -642,7 +642,7 @@ public class GridField defStr = Env.getPreference (m_vo.ctx, m_vo.AD_Window_ID, m_vo.ColumnName, false); if (!defStr.equals("")) { - log.fine("[UserPreference] " + m_vo.ColumnName + "=" + defStr); + if (log.isLoggable(Level.FINE)) log.fine("[UserPreference] " + m_vo.ColumnName + "=" + defStr); return createDefault(defStr); } @@ -652,7 +652,7 @@ public class GridField defStr = Env.getPreference (m_vo.ctx, m_vo.AD_Window_ID, m_vo.ColumnName, true); if (!defStr.equals("")) { - log.fine("[SystemPreference] " + m_vo.ColumnName + "=" + defStr); + if (log.isLoggable(Level.FINE)) log.fine("[SystemPreference] " + m_vo.ColumnName + "=" + defStr); return createDefault(defStr); } @@ -663,13 +663,13 @@ public class GridField // Button to N if (m_vo.displayType == DisplayType.Button && !m_vo.ColumnName.endsWith("_ID")) { - log.fine("[Button=N] " + m_vo.ColumnName); + if (log.isLoggable(Level.FINE)) log.fine("[Button=N] " + m_vo.ColumnName); return "N"; } // CheckBoxes default to No if (m_vo.displayType == DisplayType.YesNo) { - log.fine("[YesNo=N] " + m_vo.ColumnName); + if (log.isLoggable(Level.FINE)) log.fine("[YesNo=N] " + m_vo.ColumnName); return "N"; } // lookups with one value @@ -680,20 +680,20 @@ public class GridField // IDs remain null if (m_vo.ColumnName.endsWith("_ID")) { - log.fine("[ID=null] " + m_vo.ColumnName); + if (log.isLoggable(Level.FINE)) log.fine("[ID=null] " + m_vo.ColumnName); return null; } // actual Numbers default to zero if (DisplayType.isNumeric(m_vo.displayType)) { - log.fine("[Number=0] " + m_vo.ColumnName); + if (log.isLoggable(Level.FINE)) log.fine("[Number=0] " + m_vo.ColumnName); return createDefault("0"); } /** * No resolution */ - log.fine("[NONE] " + m_vo.ColumnName); + if (log.isLoggable(Level.FINE)) log.fine("[NONE] " + m_vo.ColumnName); return null; } // getDefault diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index 6c2bbd5c27..04a049ca6a 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -272,7 +272,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ public boolean initTab (boolean async) { - log.fine("#" + m_vo.TabNo + " - Async=" + async + " - Where=" + m_vo.WhereClause); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - Async=" + async + " - Where=" + m_vo.WhereClause); if (isLoadComplete()) return true; if (m_loaderFuture != null && m_loaderFuture.isDone()) @@ -318,7 +318,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ protected void dispose() { - log.fine("#" + m_vo.TabNo); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo); m_OrderBys = null; // m_parents.clear(); @@ -352,7 +352,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ private boolean loadFields() { - log.fine("#" + m_vo.TabNo); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo); if (m_vo.getFields() == null) return false; @@ -616,7 +616,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable Env.clearTabContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo); - log.fine("#" + m_vo.TabNo + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - Only Current Rows=" + onlyCurrentRows + ", Days=" + onlyCurrentDays + ", Detail=" + isDetail()); // is it same query? @@ -730,7 +730,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * Query */ - log.fine("#" + m_vo.TabNo + " - " + where); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - " + where); if (m_mTable.isOpen()) { if (refresh) @@ -761,20 +761,20 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable // Check: only one restriction if (query.getRestrictionCount() != 1) { - log.fine("Ignored(More than 1 Restriction): " + query); + if (log.isLoggable(Level.FINE)) log.fine("Ignored(More than 1 Restriction): " + query); return query.getWhereClause(); } String colName = query.getColumnName(0); if (colName == null) { - log.fine("Ignored(No Column): " + query); + if (log.isLoggable(Level.FINE)) log.fine("Ignored(No Column): " + query); return query.getWhereClause(); } // a '(' in the name = function - don't try to resolve if (colName.indexOf('(') != -1) { - log.fine("Ignored(Function): " + colName); + if (log.isLoggable(Level.FINE)) log.fine("Ignored(Function): " + colName); return query.getWhereClause(); } // OK - Query is valid @@ -782,7 +782,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable // Simple Query. if (getField(colName) != null) { - log.fine("Field Found: " + colName); + if (log.isLoggable(Level.FINE)) log.fine("Field Found: " + colName); return query.getWhereClause(); } @@ -821,7 +821,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable query.setColumnName(0, refColName); if (getField(refColName) != null) { - log.fine("Column " + colName + " replaced with " + refColName); + if (log.isLoggable(Level.FINE)) log.fine("Column " + colName + " replaced with " + refColName); return query.getWhereClause(); } colName = refColName; @@ -885,7 +885,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable .append(tableName).append(" xx WHERE ") .append(query.getWhereClause(true)) .append(")"); - log.fine(result.toString()); + if (log.isLoggable(Level.FINE)) log.fine(result.toString()); return result.toString(); } // validateQuery @@ -913,7 +913,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ public void dataRefreshAll (boolean fireEvent, boolean retainedCurrentRow) { - log.fine("#" + m_vo.TabNo); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo); /** @todo does not work with alpha key */ int keyNo = m_mTable.getKeyID(m_currentRow); m_mTable.dataRefreshAll(fireEvent, retainedCurrentRow ? m_currentRow : -1); @@ -971,7 +971,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ public void dataRefresh (int row, boolean fireEvent) { - log.fine("#" + m_vo.TabNo + " - row=" + row); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - row=" + row); m_mTable.dataRefresh(row, fireEvent); setCurrentRow(row, fireEvent); if (fireEvent) @@ -986,7 +986,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ public boolean dataSave(boolean manualCmd) { - log.fine("#" + m_vo.TabNo + " - row=" + m_currentRow); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - row=" + m_currentRow); try { if (hasChangedCurrentTabAndParents()) @@ -1104,7 +1104,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ public void dataIgnore() { - log.fine("#" + m_vo.TabNo); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo); if (m_mTable.isInserting()) { m_currentRow--; @@ -1113,7 +1113,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable setCurrentRow(m_currentRow, false); // re-load data fireStateChangeEvent(new StateChangeEvent(this, StateChangeEvent.DATA_IGNORE)); - log.fine("#" + m_vo.TabNo + "- fini"); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + "- fini"); } // dataIgnore @@ -1125,7 +1125,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ public boolean dataNew (boolean copy) { - log.fine("#" + m_vo.TabNo); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo); if (!isInsertRecord()) { log.warning ("Inset Not allowed in TabNo=" + m_vo.TabNo); @@ -1182,7 +1182,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ public boolean dataDelete() { - log.fine("#" + m_vo.TabNo + " - row=" + m_currentRow); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - row=" + m_currentRow); boolean retValue = m_mTable.dataDelete(m_currentRow); setCurrentRow(m_currentRow, true); fireStateChangeEvent(new StateChangeEvent(this, StateChangeEvent.DATA_DELETE)); @@ -1319,7 +1319,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable rs = null; pstmt = null; } - log.fine("AD_Column_ID=" + m_vo.AD_Column_ID + " - " + m_linkColumnName); + if (log.isLoggable(Level.FINE)) log.fine("AD_Column_ID=" + m_vo.AD_Column_ID + " - " + m_linkColumnName); } } Env.setContext(m_vo.ctx, m_vo.WindowNo, m_vo.TabNo, CTX_LinkColumnName, m_linkColumnName); @@ -1418,7 +1418,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ /*private int getTreeID() { - log.fine(m_vo.TableName); + if (log.isLoggable(Level.FINE)) log.fine(m_vo.TableName); String SQL = "SELECT * FROM AD_ClientInfo WHERE AD_Client=" + Env.getContext(m_vo.ctx, m_vo.WindowNo, "AD_Client_ID") + " ORDER BY AD_Org DESC"; @@ -1747,7 +1747,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable if (m_vo.TableName.startsWith("C_InvoiceBatch")) { int Record_ID = Env.getContextAsInt(m_vo.ctx, m_vo.WindowNo, "C_InvoiceBatch_ID"); - log.fine(m_vo.TableName + " - " + Record_ID); + if (log.isLoggable(Level.FINE)) log.fine(m_vo.TableName + " - " + Record_ID); MessageFormat mf = null; try { @@ -1836,7 +1836,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable } sql.append("GROUP BY o.C_Currency_ID, c.ISO_Code, o.TotalLines, o.GrandTotal, o.DateAcct, o.AD_Client_ID, o.AD_Org_ID"); - log.fine(m_vo.TableName + " - " + Record_ID); + if (log.isLoggable(Level.FINE)) log.fine(m_vo.TableName + " - " + Record_ID); MessageFormat mf = null; try { @@ -1907,7 +1907,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable else if (m_vo.TableName.startsWith("S_TimeExpense") && m_vo.TabNo == 0) { int Record_ID = Env.getContextAsInt(m_vo.ctx, m_vo.WindowNo, "S_TimeExpense_ID"); - log.fine(m_vo.TableName + " - " + Record_ID); + if (log.isLoggable(Level.FINE)) log.fine(m_vo.TableName + " - " + Record_ID); MessageFormat mf = null; try { @@ -2108,7 +2108,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable public void loadLocks() { int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID"); - log.fine("#" + m_vo.TabNo + " - AD_User_ID=" + AD_User_ID); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - AD_User_ID=" + AD_User_ID); if (!canHaveAttachment()) return; @@ -2144,7 +2144,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable rs = null; pstmt = null; } - log.fine("#" + m_Lock.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_Lock.size()); } // loadLooks /** @@ -2173,7 +2173,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable public void lock (Properties ctx, int Record_ID, boolean lock) { int AD_User_ID = Env.getContextAsInt(ctx, "#AD_User_ID"); - log.fine("Lock=" + lock + ", AD_User_ID=" + AD_User_ID + if (log.isLoggable(Level.FINE)) log.fine("Lock=" + lock + ", AD_User_ID=" + AD_User_ID + ", AD_Table_ID=" + m_vo.AD_Table_ID + ", Record_ID=" + Record_ID); MPrivateAccess access = MPrivateAccess.get (ctx, AD_User_ID, m_vo.AD_Table_ID, Record_ID); if (access == null) @@ -2194,7 +2194,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ public void dataStatusChanged (DataStatusEvent e) { - log.fine("#" + m_vo.TabNo + " - " + e.toString()); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - " + e.toString()); int oldCurrentRow = e.getCurrentRow(); m_DataStatusEvent = e; // save it // when sorted set current row to 0 @@ -2233,7 +2233,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable DataStatusListener[] listeners = m_listenerList.getListeners(DataStatusListener.class); if (listeners.length == 0) return; - log.fine(e.toString()); + if (log.isLoggable(Level.FINE)) log.fine(e.toString()); // WHO Info if (e.getCurrentRow() >= 0) { @@ -2410,7 +2410,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable if (newRow >= rows) { newRow = rows-1; - log.fine("Set to max Row: " + newRow); + if (log.isLoggable(Level.FINE)) log.fine("Set to max Row: " + newRow); } else if (newRow < 0) { @@ -2433,7 +2433,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable { int oldCurrentRow = m_currentRow; m_currentRow = verifyRow (newCurrentRow); - log.fine("Row=" + m_currentRow + " - fire=" + fireEvents); + if (log.isLoggable(Level.FINE)) log.fine("Row=" + m_currentRow + " - fire=" + fireEvents); // Update Field Values int size = m_mTable.getColumnCount(); @@ -2592,7 +2592,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable if (field == null) return "NoField"; - log.fine(field.getColumnName() + "=" + value + " - Row=" + m_currentRow); + if (log.isLoggable(Level.FINE)) log.fine(field.getColumnName() + "=" + value + " - Row=" + m_currentRow); if (DisplayType.isID(field.getDisplayType()) && value instanceof Integer && ((Integer)value).intValue() < 0) value = null; @@ -2662,7 +2662,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable // if the lookup is dynamic (i.e. contains this columnName as variable) if (mLookup.getValidation().indexOf("@"+columnName+"@") != -1) { - log.fine(columnName + " changed - " + if (log.isLoggable(Level.FINE)) log.fine(columnName + " changed - " + dependentField.getColumnName() + " set to null"); // invalidate current selection setValue(dependentField, null); @@ -2754,7 +2754,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable if (callout.length() == 0) return ""; - log.fine(field.getColumnName() + "=" + value + if (log.isLoggable(Level.FINE)) log.fine(field.getColumnName() + "=" + value + " (" + callout + ") - old=" + oldValue); StringTokenizer st = new StringTokenizer(callout, ";,", false); @@ -3023,7 +3023,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable * @param ascending sorting modus */ public void switchRows(int from, int to, int sortColumn, boolean ascending) { - log.fine(from + " - " + to + " - " + sortColumn + " - " + ascending); + if (log.isLoggable(Level.FINE)) log.fine(from + " - " + to + " - " + sortColumn + " - " + ascending); // nothing to do if (from == to) { log.finest("nothing to do - from == to"); diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index 28bbdfd135..d897277ef9 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -48,7 +48,6 @@ import javax.swing.table.AbstractTableModel; import org.adempiere.exceptions.DBException; import org.adempiere.util.ServerContext; import org.compiere.Adempiere; -import org.compiere.util.CLogMgt; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.DisplayType; @@ -420,7 +419,7 @@ public class GridTable extends AbstractTableModel */ public void addField (GridField field) { - log.fine("(" + m_tableName + ") - " + field.getColumnName()); + if (log.isLoggable(Level.FINE)) log.fine("(" + m_tableName + ") - " + field.getColumnName()); if (m_open) { log.log(Level.SEVERE, "Table already open - ignored: " + field.getColumnName()); @@ -428,7 +427,7 @@ public class GridTable extends AbstractTableModel } if (!MRole.getDefault(m_ctx, false).isColumnAccess (m_AD_Table_ID, field.getAD_Column_ID(), true)) { - log.fine("No Column Access " + field.getColumnName()); + if (log.isLoggable(Level.FINE)) log.fine("No Column Access " + field.getColumnName()); return; } // Set Index for Key column @@ -726,7 +725,7 @@ public class GridTable extends AbstractTableModel { if (!m_open) return; - log.fine("final=" + finalCall); + if (log.isLoggable(Level.FINE)) log.fine("final=" + finalCall); // remove listeners if (finalCall) @@ -1029,7 +1028,7 @@ public class GridTable extends AbstractTableModel //wait for 30 seconds while (row >= m_sort.size() && m_loaderFuture != null && !m_loaderFuture.isDone() && loops < 60) { - log.fine("Waiting for loader row=" + row + ", size=" + m_sort.size()); + if (log.isLoggable(Level.FINE)) log.fine("Waiting for loader row=" + row + ", size=" + m_sort.size()); try { m_loaderFuture.get(500, TimeUnit.MILLISECONDS); @@ -1224,7 +1223,7 @@ public class GridTable extends AbstractTableModel return; } - log.fine("r=" + row + " c=" + col + " = " + value + " (" + oldValue + ")"); + if (log.isLoggable(Level.FINE)) log.fine("r=" + row + " c=" + col + " = " + value + " (" + oldValue + ")"); // Save old value m_oldValue = new Object[3]; @@ -1365,7 +1364,7 @@ public class GridTable extends AbstractTableModel */ public boolean dataSave (int newRow, boolean manualCmd) { - log.fine("Row=" + newRow + + if (log.isLoggable(Level.FINE)) log.fine("Row=" + newRow + ", Changed=" + m_rowChanged + "/" + m_changed); // m_rowChanged set in setValueAt // nothing done if (!m_changed && m_rowChanged == -1) @@ -1569,7 +1568,7 @@ public class GridTable extends AbstractTableModel } else { - log.fine("Prepare updating ... manual=" + manualUpdate); + if (log.isLoggable(Level.FINE)) log.fine("Prepare updating ... manual=" + manualUpdate); // get current Data in DB rowDataDB = readData (rs); } @@ -1658,7 +1657,7 @@ public class GridTable extends AbstractTableModel if (m_inserting) insertDoc = DB.getDocumentNo (m_ctx, m_WindowNo, m_tableName, true, null); // only doc type - no trx - log.fine("DocumentNo entered=" + docNo + ", DocTypeInsert=" + insertDoc + ", newDocNo=" + newDocNo); + if (log.isLoggable(Level.FINE)) log.fine("DocumentNo entered=" + docNo + ", DocTypeInsert=" + insertDoc + ", newDocNo=" + newDocNo); // can we use entered DocNo? if (insertDoc == null || insertDoc.length () == 0) { @@ -1792,8 +1791,7 @@ public class GridTable extends AbstractTableModel || (m_rowData[col] == null && rowDataDB[col] == null) || (m_rowData[col] != null && m_rowData[col].equals (rowDataDB[col]))) { - if (CLogMgt.isLevelFinest()) - log.fine(columnName + "=" + rowData[col] + if (log.isLoggable(Level.FINE)) log.fine(columnName + "=" + rowData[col] + " " + (rowData[col]==null ? "" : rowData[col].getClass().getName())); // boolean encrypted = field.isEncryptedColumn(); @@ -1975,7 +1973,7 @@ public class GridTable extends AbstractTableModel } else { - log.fine("Updating ... " + whereClause); + if (log.isLoggable(Level.FINE)) log.fine("Updating ... " + whereClause); if (manualUpdate) { String sql = createUpdateSql(false, whereClause); @@ -1995,7 +1993,7 @@ public class GridTable extends AbstractTableModel lobSave(whereClause); // Need to re-read row to get ROWID, Key, DocumentNo, Trigger, virtual columns - log.fine("Reading ... " + whereClause); + if (log.isLoggable(Level.FINE)) log.fine("Reading ... " + whereClause); StringBuffer refreshSQL = new StringBuffer(m_SQL_Select) .append(" WHERE ").append(whereClause); pstmt = DB.prepareStatement(refreshSQL.toString(), null); @@ -2064,7 +2062,7 @@ public class GridTable extends AbstractTableModel */ private char dataSavePO (int Record_ID) throws Exception { - log.fine("ID=" + Record_ID); + if (log.isLoggable(Level.FINE)) log.fine("ID=" + Record_ID); // Object[] rowData = getDataAtRow(m_rowChanged); // @@ -2177,7 +2175,7 @@ public class GridTable extends AbstractTableModel // Refresh - update buffer String whereClause = po.get_WhereClause(true); - log.fine("Reading ... " + whereClause); + if (log.isLoggable(Level.FINE)) log.fine("Reading ... " + whereClause); StringBuffer refreshSQL = new StringBuffer(m_SQL_Select) .append(" WHERE ").append(whereClause); PreparedStatement pstmt = null; @@ -2354,7 +2352,7 @@ public class GridTable extends AbstractTableModel } sb.append(" WHERE ").append(whereClause); } - log.fine(sb.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sb.toString()); // reset createUpdateSqlReset(); return sb.toString(); @@ -2427,7 +2425,7 @@ public class GridTable extends AbstractTableModel */ private void lobAdd (PO_LOB lob) { - log.fine("LOB=" + lob); + if (log.isLoggable(Level.FINE)) log.fine("LOB=" + lob); if (m_lobInfo == null) m_lobInfo = new ArrayList(); m_lobInfo.add(lob); @@ -2536,10 +2534,10 @@ public class GridTable extends AbstractTableModel m_rowChanged = -1; // only changed in setValueAt // inform - log.fine("Current=" + currentRow + ", New=" + m_newRow); + if (log.isLoggable(Level.FINE)) log.fine("Current=" + currentRow + ", New=" + m_newRow); fireTableRowsInserted(m_newRow, m_newRow); fireDataStatusIEvent(copyCurrent ? "UpdateCopied" : "Inserted", ""); - log.fine("Current=" + currentRow + ", New=" + m_newRow + " - complete"); + if (log.isLoggable(Level.FINE)) log.fine("Current=" + currentRow + ", New=" + m_newRow + " - complete"); return true; } // dataNew @@ -2684,7 +2682,7 @@ public class GridTable extends AbstractTableModel m_rowChanged = -1; fireTableRowsDeleted(row, row); fireDataStatusIEvent("Deleted", ""); - log.fine("Row=" + row + " complete"); + if (log.isLoggable(Level.FINE)) log.fine("Row=" + row + " complete"); return true; } // dataDelete @@ -3028,7 +3026,7 @@ public class GridTable extends AbstractTableModel */ public void setReadOnly (boolean value) { - log.fine("ReadOnly=" + value); + if (log.isLoggable(Level.FINE)) log.fine("ReadOnly=" + value); m_readOnly = value; } // setReadOnly @@ -3078,7 +3076,7 @@ public class GridTable extends AbstractTableModel */ public void setDeleteable (boolean value) { - log.fine("Deleteable=" + value); + if (log.isLoggable(Level.FINE)) log.fine("Deleteable=" + value); m_deleteable = value; } // setDeleteable @@ -3410,7 +3408,7 @@ public class GridTable extends AbstractTableModel } if (log.isLoggable(Level.FINE)) - log.fine(info.toString()); + if (log.isLoggable(Level.FINE)) log.fine(info.toString()); return rows; } // open @@ -3478,7 +3476,7 @@ public class GridTable extends AbstractTableModel { if (Thread.interrupted()) { - log.fine("Interrupted"); + if (log.isLoggable(Level.FINE)) log.fine("Interrupted"); close(); return; } @@ -3510,7 +3508,7 @@ public class GridTable extends AbstractTableModel } catch (InterruptedException ie) { - log.fine("Interrupted while sleeping"); + if (log.isLoggable(Level.FINE)) log.fine("Interrupted while sleeping"); close(); return; } @@ -3549,7 +3547,7 @@ public class GridTable extends AbstractTableModel { Object para = m_parameterSELECT.get(i); if (para != null) - log.fine("Select " + i + "=" + para); + if (log.isLoggable(Level.FINE)) log.fine("Select " + i + "=" + para); // if (para == null) ; @@ -3568,7 +3566,7 @@ public class GridTable extends AbstractTableModel { Object para = m_parameterWHERE.get(i); if (para != null) - log.fine("Where " + i + "=" + para); + if (log.isLoggable(Level.FINE)) log.fine("Where " + i + "=" + para); // if (para == null) ; diff --git a/org.adempiere.base/src/org/compiere/model/Lookup.java b/org.adempiere.base/src/org/compiere/model/Lookup.java index 7e198350a7..6db890bd69 100644 --- a/org.adempiere.base/src/org/compiere/model/Lookup.java +++ b/org.adempiere.base/src/org/compiere/model/Lookup.java @@ -116,7 +116,7 @@ public abstract class Lookup extends AbstractListModel else { m_selectedObject = null; - log.fine(getColumnName() + ": setSelectedItem - Set to NULL"); + if (log.isLoggable(Level.FINE)) log.fine(getColumnName() + ": setSelectedItem - Set to NULL"); } // if (m_worker == null || !m_worker.isAlive()) fireContentsChanged(this, -1, -1); @@ -304,10 +304,10 @@ public abstract class Lookup extends AbstractListModel m_loaded = true; fireContentsChanged(this, 0, p_data.size()); if (p_data.size() == 0) - log.fine(getColumnName() + ": #0 - ms=" + if (log.isLoggable(Level.FINE)) log.fine(getColumnName() + ": #0 - ms=" + String.valueOf(System.currentTimeMillis()-startTime)); else - log.fine(getColumnName() + ": #" + p_data.size() + " - ms=" + if (log.isLoggable(Level.FINE)) log.fine(getColumnName() + ": #" + p_data.size() + " - ms=" + String.valueOf(System.currentTimeMillis()-startTime)); diff --git a/org.adempiere.base/src/org/compiere/model/MAccount.java b/org.adempiere.base/src/org/compiere/model/MAccount.java index 15d1e5208f..19e2155368 100644 --- a/org.adempiere.base/src/org/compiere/model/MAccount.java +++ b/org.adempiere.base/src/org/compiere/model/MAccount.java @@ -765,7 +765,7 @@ public class MAccount extends X_C_ValidCombination super.setDescription(descr.toString()); if (fullyQualified != isFullyQualified()) setIsFullyQualified(fullyQualified); - log.fine("Combination=" + getCombination() + if (log.isLoggable(Level.FINE)) log.fine("Combination=" + getCombination() + " - " + getDescription() + " - FullyQualified=" + fullyQualified); } // setValueDescription diff --git a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java index 17c596889b..2462891928 100644 --- a/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java +++ b/org.adempiere.base/src/org/compiere/model/MAcctSchemaElement.java @@ -512,7 +512,7 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element .append(" WHERE ").append(element).append(" IS NULL AND C_AcctSchema_ID=").append(getC_AcctSchema_ID()); int noF = DB.executeUpdate(sql.toString(), get_TrxName()); // - log.fine("ValidCombination=" + noC + ", Fact=" + noF); + if (log.isLoggable(Level.FINE)) log.fine("ValidCombination=" + noC + ", Fact=" + noF); } // updateData @Override diff --git a/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java b/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java index d8655f2f58..4899e91f1f 100644 --- a/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java @@ -284,7 +284,7 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction .append("' WHERE C_AllocationHdr_ID=").append(getC_AllocationHdr_ID()); int no = DB.executeUpdate(sql.toString(), get_TrxName()); m_lines = null; - log.fine(processed + " - #" + no); + if (log.isLoggable(Level.FINE)) log.fine(processed + " - #" + no); } // setProcessed @@ -849,7 +849,7 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction bp.setTotalOpenBalance(); // recalculates from scratch // bp.setSOCreditStatus(); // called automatically if (bp.save()) - log.fine(bp.toString()); + if (log.isLoggable(Level.FINE)) log.fine(bp.toString()); else log.log(Level.SEVERE, "BP not updated - " + bp); } diff --git a/org.adempiere.base/src/org/compiere/model/MAllocationLine.java b/org.adempiere.base/src/org/compiere/model/MAllocationLine.java index c4fcf5948a..f21bb52e72 100644 --- a/org.adempiere.base/src/org/compiere/model/MAllocationLine.java +++ b/org.adempiere.base/src/org/compiere/model/MAllocationLine.java @@ -248,7 +248,7 @@ public class MAllocationLine extends X_C_AllocationLine */ protected int processIt (boolean reverse) { - log.fine("Reverse=" + reverse + " - " + toString()); + if (log.isLoggable(Level.FINE)) log.fine("Reverse=" + reverse + " - " + toString()); int C_Invoice_ID = getC_Invoice_ID(); MInvoice invoice = getInvoice(); if (invoice != null @@ -286,13 +286,13 @@ public class MAllocationLine extends X_C_AllocationLine if (reverse) { invoice.setC_Payment_ID(0); - log.fine("C_Payment_ID=" + C_Payment_ID + if (log.isLoggable(Level.FINE)) log.fine("C_Payment_ID=" + C_Payment_ID + " Unlinked from C_Invoice_ID=" + C_Invoice_ID); } else if (invoice.isPaid()) { invoice.setC_Payment_ID(C_Payment_ID); - log.fine("C_Payment_ID=" + C_Payment_ID + if (log.isLoggable(Level.FINE)) log.fine("C_Payment_ID=" + C_Payment_ID + " Linked to C_Invoice_ID=" + C_Invoice_ID); } @@ -303,7 +303,7 @@ public class MAllocationLine extends X_C_AllocationLine + "WHERE o.C_Order_ID = (SELECT i.C_Order_ID FROM C_Invoice i " + "WHERE i.C_Invoice_ID=" + C_Invoice_ID + ")"; if (DB.executeUpdate(update, get_TrxName()) > 0) - log.fine("C_Payment_ID=" + C_Payment_ID + if (log.isLoggable(Level.FINE)) log.fine("C_Payment_ID=" + C_Payment_ID + (reverse ? " UnLinked from" : " Linked to") + " order of C_Invoice_ID=" + C_Invoice_ID); } @@ -315,13 +315,13 @@ public class MAllocationLine extends X_C_AllocationLine if (reverse) { invoice.setC_CashLine_ID(0); - log.fine("C_CashLine_ID=" + C_CashLine_ID + if (log.isLoggable(Level.FINE)) log.fine("C_CashLine_ID=" + C_CashLine_ID + " Unlinked from C_Invoice_ID=" + C_Invoice_ID); } else { invoice.setC_CashLine_ID(C_CashLine_ID); - log.fine("C_CashLine_ID=" + C_CashLine_ID + if (log.isLoggable(Level.FINE)) log.fine("C_CashLine_ID=" + C_CashLine_ID + " Linked to C_Invoice_ID=" + C_Invoice_ID); } @@ -332,7 +332,7 @@ public class MAllocationLine extends X_C_AllocationLine + "WHERE o.C_Order_ID = (SELECT i.C_Order_ID FROM C_Invoice i " + "WHERE i.C_Invoice_ID=" + C_Invoice_ID + ")"; if (DB.executeUpdate(update, get_TrxName()) > 0) - log.fine("C_CashLine_ID=" + C_CashLine_ID + if (log.isLoggable(Level.FINE)) log.fine("C_CashLine_ID=" + C_CashLine_ID + (reverse ? " UnLinked from" : " Linked to") + " order of C_Invoice_ID=" + C_Invoice_ID); } diff --git a/org.adempiere.base/src/org/compiere/model/MArchive.java b/org.adempiere.base/src/org/compiere/model/MArchive.java index bb847d6d8b..3d9207517c 100644 --- a/org.adempiere.base/src/org/compiere/model/MArchive.java +++ b/org.adempiere.base/src/org/compiere/model/MArchive.java @@ -265,7 +265,7 @@ public class MArchive extends X_AD_Archive { if (data == null || data.length == 0) return false; // - log.fine(toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString()); return true; } // beforeSave diff --git a/org.adempiere.base/src/org/compiere/model/MAsset.java b/org.adempiere.base/src/org/compiere/model/MAsset.java index d27a600d8d..26551f3c4a 100644 --- a/org.adempiere.base/src/org/compiere/model/MAsset.java +++ b/org.adempiere.base/src/org/compiere/model/MAsset.java @@ -120,7 +120,7 @@ public class MAsset extends X_A_Asset } MBPartner bp = new MBPartner(getCtx(), invoiceLine.getC_Invoice().getC_BPartner_ID(), null); name += bp.getName()+"-"+invoiceLine.getC_Invoice().getDocumentNo(); - log.fine("name=" + name); + if (log.isLoggable(Level.FINE)) log.fine("name=" + name); setValue(name); setName(name); setDescription(invoiceLine.getDescription()); @@ -379,7 +379,7 @@ public class MAsset extends X_A_Asset int A_Asset_ID = getA_Asset_ID(); setA_Parent_Asset_ID(A_Asset_ID); DB.executeUpdateEx("UPDATE A_Asset SET A_Parent_Asset_ID=A_Asset_ID WHERE A_Asset_ID=" + A_Asset_ID, get_TrxName()); - log.fine("A_Parent_Asset_ID=" + getA_Parent_Asset_ID()); + if (log.isLoggable(Level.FINE)) log.fine("A_Parent_Asset_ID=" + getA_Parent_Asset_ID()); } // @@ -390,7 +390,7 @@ public class MAsset extends X_A_Asset invNo = "" + get_ID(); setInventoryNo(invNo); DB.executeUpdateEx("UPDATE A_Asset SET InventoryNo=" + DB.TO_STRING(invNo) + " WHERE A_Asset_ID=" + getA_Asset_ID(), get_TrxName()); - log.fine("InventoryNo=" + getInventoryNo()); + if (log.isLoggable(Level.FINE)) log.fine("InventoryNo=" + getInventoryNo()); } diff --git a/org.adempiere.base/src/org/compiere/model/MAssetAddition.java b/org.adempiere.base/src/org/compiere/model/MAssetAddition.java index 06ecbcba7a..6b9adb82c0 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetAddition.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetAddition.java @@ -268,7 +268,7 @@ public class MAssetAddition extends X_A_Asset_Addition if (dateAcct != null) { dateAcct = UseLifeImpl.getDateAcct(dateAcct, 1); - log.fine("DateAcct=" + dateAcct); + if (log.isLoggable(Level.FINE)) log.fine("DateAcct=" + dateAcct); setDateAcct(dateAcct); } setC_Project(project); @@ -319,7 +319,7 @@ public class MAssetAddition extends X_A_Asset_Addition if (dateAcct != null) { //dateAcct = UseLifeImpl.getDateAcct(dateAcct, 1); //commented by @win -- i don't see why i should add 1 month - log.fine("DateAcct=" + dateAcct); + if (log.isLoggable(Level.FINE)) log.fine("DateAcct=" + dateAcct); setDateAcct(dateAcct); } setI_FixedAsset(ifa); @@ -478,7 +478,7 @@ public class MAssetAddition extends X_A_Asset_Addition { String str = Env.getContext(getCtx(), "#IsCanApproveOwnDoc"); boolean isApproved = "Y".equals(str); //ARHIPAC.toBoolean(str, false); - log.fine("#IsCanApproveOwnDoc=" + str + "=" + isApproved); + if (log.isLoggable(Level.FINE)) log.fine("#IsCanApproveOwnDoc=" + str + "=" + isApproved); setIsApproved(isApproved); } } @@ -650,7 +650,7 @@ public class MAssetAddition extends X_A_Asset_Addition //loading asset MAsset asset = getA_Asset(!m_justPrepared); // requery if not just prepared - log.fine("asset=" + asset); + if (log.isLoggable(Level.FINE)) log.fine("asset=" + asset); // // Get/Create Asset Workfile: @@ -660,7 +660,7 @@ public class MAssetAddition extends X_A_Asset_Addition { assetwk = new MDepreciationWorkfile(asset, getPostingType(), null); } - log.fine("workfile: " + assetwk); + if (log.isLoggable(Level.FINE)) log.fine("workfile: " + assetwk); // // Can not upgrade a previous period /* diff --git a/org.adempiere.base/src/org/compiere/model/MAssetChange.java b/org.adempiere.base/src/org/compiere/model/MAssetChange.java index 3270c53b71..cf5fd482a6 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetChange.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetChange.java @@ -19,7 +19,6 @@ import java.util.logging.Level; import org.compiere.model.MRefList; import org.compiere.model.PO; -import org.compiere.util.CLogMgt; import org.compiere.util.CLogger; /** @@ -123,7 +122,7 @@ public class MAssetChange extends X_A_Asset_Change } public void addChanges(PO po) { - if(CLogMgt.isLevelFine()) log.fine("Entering: po=" + po); + if (log.isLoggable(Level.FINE)) log.fine("Entering: po=" + po); if (po == null) { return; } @@ -145,7 +144,7 @@ public class MAssetChange extends X_A_Asset_Change } */ // - if(CLogMgt.isLevelFine()) log.fine("Leaving: po=" + po); + if (log.isLoggable(Level.FINE)) log.fine("Leaving: po=" + po); } /** ARHIPAC: TEO: END ------------------------------------------------------------------ */ } // MAssetChange \ No newline at end of file diff --git a/org.adempiere.base/src/org/compiere/model/MAssetClass.java b/org.adempiere.base/src/org/compiere/model/MAssetClass.java index f8ddc39768..e9653cfa42 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetClass.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetClass.java @@ -4,10 +4,10 @@ import java.sql.ResultSet; import java.sql.Timestamp; import java.util.Calendar; import java.util.Properties; +import java.util.logging.Level; import org.compiere.model.Query; import org.compiere.util.CCache; -import org.compiere.util.CLogMgt; import org.compiere.util.Env; import org.compiere.util.TimeUtil; import org.idempiere.fa.feature.UseLifeImpl; @@ -151,9 +151,7 @@ public class MAssetClass extends X_A_Asset_Class A_Life_Period_Max = getA_Life_Period_2004(); } // logging: - if (CLogMgt.isLevelFine()) { - log.fine("serviceDate=" + serviceDate + ", A_Life_Period_Min=" + A_Life_Period_Min + ", A_Life_Period_Max=" + A_Life_Period_Max + ", A_Life_Period=" + A_Life_Period); - } + if (log.isLoggable(Level.FINE)) log.fine("serviceDate=" + serviceDate + ", A_Life_Period_Min=" + A_Life_Period_Min + ", A_Life_Period_Max=" + A_Life_Period_Max + ", A_Life_Period=" + A_Life_Period); if (A_Life_Period < A_Life_Period_Min || A_Life_Period > A_Life_Period_Max) { @@ -161,7 +159,7 @@ public class MAssetClass extends X_A_Asset_Class if (saveError) { log.saveError("Error", errmsg); } - if(CLogMgt.isLevelFine()) { + if (log.isLoggable(Level.FINE)) { log.fine("Leaving: " + errmsg); Thread.dumpStack(); } @@ -175,7 +173,7 @@ public class MAssetClass extends X_A_Asset_Class /** Validate UseLifeImpl model */ public boolean validate(UseLifeImpl asset) { - if(CLogMgt.isLevelFine()) log.fine("Entering: UseLifeImpl=" + asset); + if (log.isLoggable(Level.FINE)) log.fine("Entering: UseLifeImpl=" + asset); if (!asset.isFiscal()) { log.fine("Leaving: fiscal=false [RETURN TRUE]"); @@ -190,7 +188,7 @@ public class MAssetClass extends X_A_Asset_Class String errmsg = validate(true, A_Life_Period, serviceDate); boolean ok = (errmsg == null || errmsg.length() == 0); - log.fine("Leaving: ok=" + ok); + if (log.isLoggable(Level.FINE)) log.fine("Leaving: ok=" + ok); return ok; } diff --git a/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java b/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java index 06d83d8479..850f5fa3d2 100644 --- a/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java +++ b/org.adempiere.base/src/org/compiere/model/MAssetDisposed.java @@ -192,7 +192,7 @@ implements DocAction //loading asset MAsset asset = getAsset(); - log.fine("asset=" + asset); + if (log.isLoggable(Level.FINE)) log.fine("asset=" + asset); // Activation if(!isDisposal()) diff --git a/org.adempiere.base/src/org/compiere/model/MAttachment.java b/org.adempiere.base/src/org/compiere/model/MAttachment.java index ed6a6a0895..50fca012ab 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttachment.java +++ b/org.adempiere.base/src/org/compiere/model/MAttachment.java @@ -215,7 +215,7 @@ public class MAttachment extends X_AD_Attachment + ", Exists=" + file.exists() + ", Directory=" + file.isDirectory()); return false; } - log.fine("addEntry - " + file); + if (log.isLoggable(Level.FINE)) log.fine("addEntry - " + file); // String name = file.getName(); byte[] data = null; @@ -291,7 +291,7 @@ public class MAttachment extends X_AD_Attachment if (!replaced) { retValue = m_items.add(item); } - log.fine(item.toStringX()); + if (log.isLoggable(Level.FINE)) log.fine(item.toStringX()); setBinaryData(new byte[0]); // ATTENTION! HEAVY HACK HERE... Else it will not save :( return retValue || replaced; } // addEntry @@ -565,7 +565,7 @@ public class MAttachment extends X_AD_Attachment + ", Exists=" + file.exists() + ", Directory=" + file.isDirectory()); return false; } - log.fine("updateEntry - " + file); + if (log.isLoggable(Level.FINE)) log.fine("updateEntry - " + file); // byte[] data = null; try diff --git a/org.adempiere.base/src/org/compiere/model/MAttribute.java b/org.adempiere.base/src/org/compiere/model/MAttribute.java index edcbc2df6c..ad8212af46 100644 --- a/org.adempiere.base/src/org/compiere/model/MAttribute.java +++ b/org.adempiere.base/src/org/compiere/model/MAttribute.java @@ -251,7 +251,7 @@ public class MAttribute extends X_M_Attribute .append("WHERE mas.M_AttributeSet_ID=mau.M_AttributeSet_ID") .append(" AND mau.M_Attribute_ID=").append(getM_Attribute_ID()).append(")"); int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("AttributeSet Instance set #" + no); + if (log.isLoggable(Level.FINE)) log.fine("AttributeSet Instance set #" + no); } return success; } // afterSave diff --git a/org.adempiere.base/src/org/compiere/model/MBPartner.java b/org.adempiere.base/src/org/compiere/model/MBPartner.java index ae322565e6..5b6978b844 100644 --- a/org.adempiere.base/src/org/compiere/model/MBPartner.java +++ b/org.adempiere.base/src/org/compiere/model/MBPartner.java @@ -244,7 +244,7 @@ public class MBPartner extends X_C_BPartner setShareOfCustomer(0); setSalesVolume(0); } - log.fine(toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString()); } // MBPartner /** diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatement.java b/org.adempiere.base/src/org/compiere/model/MBankStatement.java index d5a41708dc..24a41a7c31 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatement.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatement.java @@ -22,6 +22,7 @@ import java.sql.ResultSet; import java.sql.Timestamp; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import org.compiere.process.DocAction; import org.compiere.process.DocumentEngine; @@ -170,7 +171,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction .append("' WHERE C_BankStatement_ID=").append(getC_BankStatement_ID()); int noLine = DB.executeUpdate(sql.toString(), get_TrxName()); m_lines = null; - log.fine("setProcessed - " + processed + " - Lines=" + noLine); + if (log.isLoggable(Level.FINE)) log.fine("setProcessed - " + processed + " - Lines=" + noLine); } // setProcessed /** diff --git a/org.adempiere.base/src/org/compiere/model/MCStage.java b/org.adempiere.base/src/org/compiere/model/MCStage.java index b512702684..6e77389e36 100644 --- a/org.adempiere.base/src/org/compiere/model/MCStage.java +++ b/org.adempiere.base/src/org/compiere/model/MCStage.java @@ -211,7 +211,7 @@ public class MCStage extends X_CM_CStage .append(", 0, 999)"); int no = DB.executeUpdate(sb.toString(), get_TrxName()); if (no > 0) - log.fine("#" + no + " - TreeType=CMS"); + if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMS"); else log.warning("#" + no + " - TreeType=CMS"); return no > 0; @@ -236,7 +236,7 @@ public class MCStage extends X_CM_CStage .append(" AND AD_Tree_ID=").append(getAD_Tree_ID()); int no = DB.executeUpdate(sb.toString(), get_TrxName()); if (no > 0) - log.fine("#" + no + " - TreeType=CMS"); + if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMS"); else log.warning("#" + no + " - TreeType=CMS"); return no > 0; diff --git a/org.adempiere.base/src/org/compiere/model/MCash.java b/org.adempiere.base/src/org/compiere/model/MCash.java index 4e4adf1f81..d8fadf6608 100644 --- a/org.adempiere.base/src/org/compiere/model/MCash.java +++ b/org.adempiere.base/src/org/compiere/model/MCash.java @@ -22,6 +22,7 @@ import java.sql.ResultSet; import java.sql.Timestamp; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import org.compiere.process.DocAction; import org.compiere.process.DocumentEngine; @@ -771,7 +772,7 @@ public class MCash extends X_C_Cash implements DocAction .append("' WHERE C_Cash_ID=").append(getC_Cash_ID()); int noLine = DB.executeUpdate (sql.toString(), get_TrxName()); m_lines = null; - log.fine(processed + " - Lines=" + noLine); + if (log.isLoggable(Level.FINE)) log.fine(processed + " - Lines=" + noLine); } // setProcessed /** diff --git a/org.adempiere.base/src/org/compiere/model/MClick.java b/org.adempiere.base/src/org/compiere/model/MClick.java index 9af7f449ab..f31f43326d 100644 --- a/org.adempiere.base/src/org/compiere/model/MClick.java +++ b/org.adempiere.base/src/org/compiere/model/MClick.java @@ -153,7 +153,7 @@ public class MClick extends X_W_Click // remove everything after / if (slash != -1) url = url.substring(0, slash); - log.fine(exactURL + " -> " + url); + if (log.isLoggable(Level.FINE)) log.fine(exactURL + " -> " + url); int W_ClickCount_ID = search (url, exactURL); // try minumum if (W_ClickCount_ID == 0) @@ -166,7 +166,7 @@ public class MClick extends X_W_Click lastDot = url.lastIndexOf('.'); firstDot = url.indexOf('.'); } - log.fine(exactURL + " -> " + url); + if (log.isLoggable(Level.FINE)) log.fine(exactURL + " -> " + url); W_ClickCount_ID = search (url, exactURL); } // Not found diff --git a/org.adempiere.base/src/org/compiere/model/MColor.java b/org.adempiere.base/src/org/compiere/model/MColor.java index 46cba1004c..ae63a0900b 100644 --- a/org.adempiere.base/src/org/compiere/model/MColor.java +++ b/org.adempiere.base/src/org/compiere/model/MColor.java @@ -87,7 +87,7 @@ public class MColor extends X_AD_Color { String colName = p_info.getColumnName(index); String colValue = value == null ? "null" : value.getClass().toString(); - log.fine(colName + "=" + colValue); + if (log.isLoggable(Level.FINE)) log.fine(colName + "=" + colValue); if (value == null) return "NULL"; return value.toString(); diff --git a/org.adempiere.base/src/org/compiere/model/MColumn.java b/org.adempiere.base/src/org/compiere/model/MColumn.java index 1ffbbcb11d..1b52b0e44f 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MColumn.java @@ -319,7 +319,7 @@ public class MColumn extends X_AD_Column .append(" WHERE AD_Column_ID=").append(get_ID()) .append(" AND IsCentrallyMaintained='Y'"); int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("afterSave - Fields updated #" + no); + if (log.isLoggable(Level.FINE)) log.fine("afterSave - Fields updated #" + no); } } return success; diff --git a/org.adempiere.base/src/org/compiere/model/MContactInterest.java b/org.adempiere.base/src/org/compiere/model/MContactInterest.java index 7de2cc8cff..dcc02997f7 100644 --- a/org.adempiere.base/src/org/compiere/model/MContactInterest.java +++ b/org.adempiere.base/src/org/compiere/model/MContactInterest.java @@ -124,7 +124,7 @@ public class MContactInterest extends X_R_ContactInterest { if (OptOutDate == null) OptOutDate = new Timestamp(System.currentTimeMillis()); - log.fine("" + OptOutDate); + if (log.isLoggable(Level.FINE)) log.fine("" + OptOutDate); super.setOptOutDate(OptOutDate); setIsActive(false); } // setOptOutDate @@ -156,7 +156,7 @@ public class MContactInterest extends X_R_ContactInterest { if (SubscribeDate == null) SubscribeDate = new Timestamp(System.currentTimeMillis()); - log.fine("" + SubscribeDate); + if (log.isLoggable(Level.FINE)) log.fine("" + SubscribeDate); super.setSubscribeDate(SubscribeDate); super.setOptOutDate(null); setIsActive(true); diff --git a/org.adempiere.base/src/org/compiere/model/MContainer.java b/org.adempiere.base/src/org/compiere/model/MContainer.java index 1cd050165e..33db8d86e8 100644 --- a/org.adempiere.base/src/org/compiere/model/MContainer.java +++ b/org.adempiere.base/src/org/compiere/model/MContainer.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.CLogger; import org.compiere.util.DB; @@ -444,7 +445,7 @@ public class MContainer extends X_CM_Container ", 0, 999)"); int no = DB.executeUpdate (sb.toString (), get_TrxName ()); if (no > 0) - log.fine ("#" + no + " - TreeType=CMC"); + if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMC"); else log.warning ("#" + no + " - TreeType=CMC"); return no > 0; @@ -488,7 +489,7 @@ public class MContainer extends X_CM_Container " AND AD_Tree_ID=").append (getAD_Tree_ID ()); int no = DB.executeUpdate (sb.toString (), get_TrxName ()); if (no > 0) - log.fine ("#" + no + " - TreeType=CMC"); + if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMC"); else log.warning ("#" + no + " - TreeType=CMC"); return no > 0; @@ -511,7 +512,7 @@ public class MContainer extends X_CM_Container int no = DB.executeUpdate (sb.toString (), get_TrxName ()); // If 0 than there is nothing to delete which is okay. if (no > 0) - log.fine ("#" + no + " - TreeType=CMC"); + if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMC"); else log.warning ("#" + no + " - TreeType=CMC"); return true; diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciation.java b/org.adempiere.base/src/org/compiere/model/MDepreciation.java index 783c78d4fe..5e99ed0200 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciation.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciation.java @@ -153,7 +153,7 @@ public class MDepreciation extends X_A_Depreciation if(CLogMgt.isLevelFinest()) { - log.fine("Entering: DepreciationType=" + depreciationType + if (log.isLoggable(Level.FINE)) log.fine("Entering: DepreciationType=" + depreciationType + ", assetwk=" + assetwk+ ", assetacct=" + assetAcct + ", A_Current_Period=" + A_Current_Period //+ " (offset=" + offset + ")" + ", Accum_Dep=" + Accum_Dep @@ -195,7 +195,7 @@ public class MDepreciation extends X_A_Depreciation } retValue = retValue.setScale(getPrecision(), RoundingMode.HALF_UP); // - if(CLogMgt.isLevelFinest()) log.fine("Leaving: retValue=" + retValue); + if (log.isLoggable(Level.FINE)) log.fine("Leaving: retValue=" + retValue); return retValue; } // invoke @@ -296,9 +296,7 @@ public class MDepreciation extends X_A_Depreciation BigDecimal remainingPeriods = new BigDecimal(wk.getRemainingPeriods(A_Current_Period)); assetExp = remainingAmt.divide(remainingPeriods, getPrecision(), RoundingMode.HALF_UP); // logging - if (CLogMgt.isLevelFinest()) { - log.fine("remainingAmt=" + remainingAmt + ", remainingPeriods=" + remainingPeriods+ " => assetExp=" + assetExp); - } + if (log.isLoggable(Level.FINE)) log.fine("remainingAmt=" + remainingAmt + ", remainingPeriods=" + remainingPeriods+ " => assetExp=" + assetExp); } return assetExp; @@ -345,7 +343,7 @@ public class MDepreciation extends X_A_Depreciation //~ BigDecimal DUR = BD_100.multiply( // logging - if (CLogMgt.isLevelFinest()) { + if (log.isLoggable(Level.FINE)) { log.fine("assetAmt=" + assetAmt + ", A_Life_Period=" + A_Life_Period); log.fine("A_Current_Year=" + A_Current_Year + ", A_Life_Year=" + A_Life_Year); //log.fine("coef_K=" + coef_K + ", coef_sl=" + coef_sl + ", coef_ad1=" + coef_ad1); //commented out by @win @@ -397,7 +395,7 @@ public class MDepreciation extends X_A_Depreciation BigDecimal assetExp = getPeriodExp(A_Current_Period, amtPerYear); /** Depreciation refund */ - if (CLogMgt.isLevelFinest()) log.fine("assetExp=" + assetExp); + if (log.isLoggable(Level.FINE)) log.fine("assetExp=" + assetExp); return assetExp; } @@ -455,10 +453,7 @@ public class MDepreciation extends X_A_Depreciation assetExp = assetExp.add(adj).setScale(getPrecision(), RoundingMode.HALF_UP); } - if (CLogMgt.isLevelFinest()) - { - log.fine("amtPerYear=" + amtPerYear + ", amtPerMonth=" + amtPerMonth + ", adj=" + adj + " => assetExp=" + assetExp); - } + if (log.isLoggable(Level.FINE)) log.fine("amtPerYear=" + amtPerYear + ", amtPerMonth=" + amtPerMonth + ", adj=" + adj + " => assetExp=" + assetExp); return assetExp; } diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java b/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java index f7b72894f8..10aa841d72 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationConvention.java @@ -6,7 +6,6 @@ import java.util.Properties; import java.util.logging.Level; import org.compiere.util.CCache; -import org.compiere.util.CLogMgt; import org.compiere.util.DB; /** Convention for the first year of depreciation (ex. FMCON, FYCON ...) @@ -74,8 +73,7 @@ public class MDepreciationConvention extends X_A_Depreciation_Convention String conventionType = getConventionType(); BigDecimal retValue = null; - if(CLogMgt.isLevelFine()) - log.fine("Entering: ConventionType=" + conventionType + if (log.isLoggable(Level.FINE)) log.fine("Entering: ConventionType=" + conventionType + "A_Asset_ID=" + A_Asset_ID + ", PostingType=" + PostingType + ", A_Asset_Acct_ID=" + A_Asset_Acct_ID + ", Flag=" + Flag + ", Period=" + Period ); @@ -109,7 +107,7 @@ public class MDepreciationConvention extends X_A_Depreciation_Convention retValue = BigDecimal.ZERO; } // - if(CLogMgt.isLevelFine()) log.fine("Leaving: retValue=" + retValue); + if (log.isLoggable(Level.FINE)) log.fine("Leaving: retValue=" + retValue); return retValue; } diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationEntry.java b/org.adempiere.base/src/org/compiere/model/MDepreciationEntry.java index 3ac40faa28..72d8d0ae23 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationEntry.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationEntry.java @@ -113,7 +113,7 @@ implements DocAction id = get_IDOld(); } int no = DB.executeUpdateEx(sql, new Object[]{id}, get_TrxName()); - log.fine("Updated #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Updated #" + no); } private void selectLines() @@ -130,7 +130,7 @@ implements DocAction ; Timestamp dateAcct = TimeUtil.trunc(getDateAcct(), TimeUtil.TRUNC_MONTH); int no = DB.executeUpdateEx(sql, new Object[]{get_ID(), dateAcct, getAD_Client_ID(), getAD_Org_ID()}, get_TrxName()); - log.fine("Updated #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Updated #" + no); } /** diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationMethod.java b/org.adempiere.base/src/org/compiere/model/MDepreciationMethod.java index 7b570c5f5e..cf5317d683 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationMethod.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationMethod.java @@ -5,6 +5,7 @@ import java.sql.CallableStatement; 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.model.Query; @@ -145,7 +146,7 @@ public class MDepreciationMethod extends X_A_Depreciation_Method String depreciationType = getDepreciationType(); BigDecimal retValue = null; - if(CLogMgt.isLevelFine()) + if (log.isLoggable(Level.FINE)) log.fine("Entering: DepreciationMethodType=" + depreciationType + ", A_Asset_ID=" + A_Asset_ID + ", A_Asset_Adjustment=" + A_Asset_Adjustment + ", A_PeriodNo=" + A_PeriodNo + ", PostingType=" + PostingType + ", A_Asset_Acct_ID=" + A_Asset_Acct_ID @@ -195,7 +196,7 @@ public class MDepreciationMethod extends X_A_Depreciation_Method retValue = BigDecimal.ZERO; } // - if(CLogMgt.isLevelFine()) log.fine("Leaving: retValue=" + retValue); + if(CLogMgt.isLevelFine()) if (log.isLoggable(Level.FINE)) log.fine("Leaving: retValue=" + retValue); return retValue; } @@ -218,7 +219,7 @@ public class MDepreciationMethod extends X_A_Depreciation_Method } BigDecimal periodAdjustment = A_Asset_Adjustment.divide(remainingPeriods, getPrecision(), RoundingMode.HALF_UP); - if(CLogMgt.isLevelFine()) { + if (log.isLoggable(Level.FINE)) { log.fine("A_Asset_Adjustment=" + A_Asset_Adjustment + ", remainingPeriods=" + remainingPeriods + " => periodAdjustment=" + periodAdjustment); } return periodAdjustment; @@ -241,7 +242,7 @@ public class MDepreciationMethod extends X_A_Depreciation_Method BigDecimal periodAdjustment = A_Asset_Adjustment.divide(remainingPeriods, getPrecision(), RoundingMode.HALF_UP); - if(CLogMgt.isLevelFine()) { + if (log.isLoggable(Level.FINE)) { log.fine("A_Asset_Adjustment=" + A_Asset_Adjustment + ", remainingPeriods=" + remainingPeriods + " => periodAdjustment=" + periodAdjustment); } return periodAdjustment; diff --git a/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java b/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java index 8983b96107..519562c7a9 100644 --- a/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java +++ b/org.adempiere.base/src/org/compiere/model/MDepreciationWorkfile.java @@ -5,6 +5,7 @@ import java.sql.ResultSet; import java.sql.Timestamp; import java.util.Collection; import java.util.Properties; +import java.util.logging.Level; import org.apache.commons.collections.keyvalue.MultiKey; import org.compiere.util.CCache; @@ -351,7 +352,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile Timestamp lastActionDate = getLastActionDate(); boolean isDepr = !date.after(lastActionDate); // date <= lastActionDate - log.fine("LastActionDate=" + lastActionDate + ", GivenDate=" + date + " => isDepreciated=" + isDepr); + if (log.isLoggable(Level.FINE)) log.fine("LastActionDate=" + lastActionDate + ", GivenDate=" + date + " => isDepreciated=" + isDepr); return isDepr; } @@ -425,7 +426,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile setA_Asset_Cost(newCost); setA_QTY_Current(newQty); - if(CLogMgt.isLevelFine()) log.fine("adjustCost(" + deltaAmt + ", " + deltaQty + ", reset=" + reset + ") => amt=" + getA_Asset_Cost() + ", qty=" + getA_QTY_Current()); + if (log.isLoggable(Level.FINE)) log.fine("adjustCost(" + deltaAmt + ", " + deltaQty + ", reset=" + reset + ") => amt=" + getA_Asset_Cost() + ", qty=" + getA_QTY_Current()); } /** @@ -455,12 +456,12 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile */ public void adjustUseLife(int deltaUseLifeYears, int deltaUseLifeYears_F, boolean reset) { - if(CLogMgt.isLevelFine()) log.fine("Entering: deltaUseLifeYears=" + deltaUseLifeYears + ", deltaUseLifeYears_F=" + deltaUseLifeYears_F); + if (log.isLoggable(Level.FINE)) log.fine("Entering: deltaUseLifeYears=" + deltaUseLifeYears + ", deltaUseLifeYears_F=" + deltaUseLifeYears_F); // UseLifeImpl.get(this, false).adjustUseLifeYears(deltaUseLifeYears, reset); UseLifeImpl.get(this, true).adjustUseLifeYears(deltaUseLifeYears_F, reset); // - if(CLogMgt.isLevelFine()) log.fine("Leaving"); + if (log.isLoggable(Level.FINE)) log.fine("Leaving"); } /** */ @@ -549,7 +550,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile setA_Current_Period(new_period); setDateAcct(new_date); // - if(CLogMgt.isLevelFine()) log.fine("(A_Current_Period, DateAcct)=(" + old_period + ", " + old_date + ")->(" + new_period + ", " + new_date + ")"); + if (log.isLoggable(Level.FINE)) log.fine("(A_Current_Period, DateAcct)=(" + old_period + ", " + old_date + ")->(" + new_period + ", " + new_date + ")"); } /** @@ -669,7 +670,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile exp_C, exp_F, accumDep_C, accumDep_F, help, get_TrxName()); - if(CLogMgt.isLevelFine()) + if (log.isLoggable(Level.FINE)) { String info = "" + cnt + ": period=" + currentPeriod + "/" + lifePeriods_C + "|" + lifePeriods_F + ", exp=" + exp_C + "|" + exp_F + ", accumDep=" + accumDep_C + "|" + accumDep_F @@ -678,7 +679,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile sb.append(info + Env.NL); } } // for - log.fine(sb.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sb.toString()); m_buildDepreciation = false; } // buildDepreciation @@ -703,7 +704,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile ; Object[] params = new Object[]{false, A_Current_Period, getA_Asset_ID(), getPostingType()}; int no = DB.executeUpdateEx(sql, params, trxName); - log.fine("sql=" + sql + "\nDeleted #" + no); + if (log.isLoggable(Level.FINE)) log.fine("sql=" + sql + "\nDeleted #" + no); } // truncDepreciation /** diff --git a/org.adempiere.base/src/org/compiere/model/MDiscountSchema.java b/org.adempiere.base/src/org/compiere/model/MDiscountSchema.java index c5d8b2b7a6..fa793e1ca7 100644 --- a/org.adempiere.base/src/org/compiere/model/MDiscountSchema.java +++ b/org.adempiere.base/src/org/compiere/model/MDiscountSchema.java @@ -191,7 +191,7 @@ public class MDiscountSchema extends X_M_DiscountSchema int M_Product_ID, int M_Product_Category_ID, BigDecimal BPartnerFlatDiscount) { - log.fine("Price=" + Price + ",Qty=" + Qty); + if (log.isLoggable(Level.FINE)) log.fine("Price=" + Price + ",Qty=" + Qty); if (Price == null || Env.ZERO.compareTo(Price) == 0) return Price; // @@ -205,7 +205,7 @@ public class MDiscountSchema extends X_M_DiscountSchema BigDecimal multiplier = (onehundred).subtract(discount); multiplier = multiplier.divide(onehundred, 6, BigDecimal.ROUND_HALF_UP); BigDecimal newPrice = Price.multiply(multiplier); - log.fine("=>" + newPrice); + if (log.isLoggable(Level.FINE)) log.fine("=>" + newPrice); return newPrice; } // calculatePrice @@ -278,7 +278,7 @@ public class MDiscountSchema extends X_M_DiscountSchema discount = BPartnerFlatDiscount; else discount = br.getBreakDiscount(); - log.fine("Discount=>" + discount); + if (log.isLoggable(Level.FINE)) log.fine("Discount=>" + discount); return discount; } // for all breaks diff --git a/org.adempiere.base/src/org/compiere/model/MDistribution.java b/org.adempiere.base/src/org/compiere/model/MDistribution.java index b1e536c4ce..5ceb4eb07b 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistribution.java +++ b/org.adempiere.base/src/org/compiere/model/MDistribution.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.CCache; import org.compiere.util.CLogMgt; @@ -382,7 +383,7 @@ public class MDistribution extends X_GL_Distribution for (int i = 0; i < m_lines.length; i++) { if (m_lines[i].isActive()) - log.fine("distribute = Amt=" + m_lines[i].getAmt() + " - " + m_lines[i].getAccount()); + if (log.isLoggable(Level.FINE)) log.fine("distribute = Amt=" + m_lines[i].getAmt() + " - " + m_lines[i].getAccount()); } } } // distribute diff --git a/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java b/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java index a4590e2b9f..c4c54a2292 100644 --- a/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java +++ b/org.adempiere.base/src/org/compiere/model/MDistributionRunDetail.java @@ -173,7 +173,7 @@ public class MDistributionRunDetail extends X_T_DistributionRunDetail } else setQty(qty.add(diff)); - log.fine("Qty=" + qty + ", Min=" + getMinQty() + if (log.isLoggable(Level.FINE)) log.fine("Qty=" + qty + ", Min=" + getMinQty() + ", Max=" + max + ", Diff=" + diff + ", newQty=" + getQty() + ", Remaining=" + remaining); return remaining; diff --git a/org.adempiere.base/src/org/compiere/model/MDocType.java b/org.adempiere.base/src/org/compiere/model/MDocType.java index ff2185b82d..c48daad779 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocType.java +++ b/org.adempiere.base/src/org/compiere/model/MDocType.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.DB; @@ -283,7 +284,7 @@ public class MDocType extends X_C_DocType .append(")"); int docact = DB.executeUpdate(sqlDocAction.toString(), get_TrxName()); - log.fine("AD_Document_Action_Access=" + docact); + if (log.isLoggable(Level.FINE)) log.fine("AD_Document_Action_Access=" + docact); } return success; } // afterSave @@ -298,7 +299,7 @@ public class MDocType extends X_C_DocType // delete access records StringBuilder msgdb = new StringBuilder("DELETE FROM AD_Document_Action_Access WHERE C_DocType_ID=").append(get_ID()); int docactDel = DB.executeUpdate(msgdb.toString(), get_TrxName()); - log.fine("Delete AD_Document_Action_Access=" + docactDel + " for C_DocType_ID: " + get_ID()); + if (log.isLoggable(Level.FINE)) log.fine("Delete AD_Document_Action_Access=" + docactDel + " for C_DocType_ID: " + get_ID()); return docactDel >= 0; } // beforeDelete diff --git a/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java b/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java index d56805ccfb..07e560db8c 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java +++ b/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java @@ -308,7 +308,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter // String dtBT = dt.getDocBaseType(); String c_dtBT = c_dt.getDocBaseType(); - log.fine(dtBT + " -> " + c_dtBT); + if (log.isLoggable(Level.FINE)) log.fine(dtBT + " -> " + c_dtBT); // SO / PO if ((MDocType.DOCBASETYPE_SalesOrder.equals(dtBT) && MDocType.DOCBASETYPE_PurchaseOrder.equals(c_dtBT)) diff --git a/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java b/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java index ab15920766..bf83b5578f 100644 --- a/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java +++ b/org.adempiere.base/src/org/compiere/model/MIFixedAsset.java @@ -5,12 +5,12 @@ import java.math.RoundingMode; import java.sql.ResultSet; import java.sql.Timestamp; import java.util.Properties; +import java.util.logging.Level; import org.adempiere.exceptions.FillMandatoryException; import org.compiere.model.MClient; import org.compiere.model.MProduct; import org.compiere.model.MUOM; -import org.compiere.util.CLogMgt; import org.compiere.util.DB; import org.compiere.util.DisplayType; import org.compiere.util.Env; @@ -74,7 +74,7 @@ public class MIFixedAsset extends X_I_FixedAsset whereClause.append(" AND AD_Client_ID=").append(getAD_Client_ID()); String sql = "SELECT M_Product_ID FROM M_Product WHERE " + whereClause.toString(); M_Product_ID = DB.getSQLValueEx(trxName, sql); - log.fine("M_Product_ID=" + M_Product_ID + " -- sql=" + sql); + if (log.isLoggable(Level.FINE)) log.fine("M_Product_ID=" + M_Product_ID + " -- sql=" + sql); } MProduct prod = null; @@ -123,7 +123,7 @@ public class MIFixedAsset extends X_I_FixedAsset int precision = getStdPrecision(); BigDecimal newAmt = amt.setScale(getStdPrecision(), RoundingMode.HALF_UP); set_Value(idx, newAmt); - if(CLogMgt.isLevelFine()) log.fine(getInventoryNo() + ": " + get_ColumnName(idx) + "=" + amt + "->" + newAmt + " (precision=" + precision + ")"); + if (log.isLoggable(Level.FINE)) log.fine(getInventoryNo() + ": " + get_ColumnName(idx) + "=" + amt + "->" + newAmt + " (precision=" + precision + ")"); //~ } catch (Exception e) {} } @@ -135,7 +135,7 @@ public class MIFixedAsset extends X_I_FixedAsset if (name == null) return; String newName = name.trim().replaceAll("[ ]+", " "); - if(CLogMgt.isLevelFine()) log.fine(getInventoryNo() + ": " + get_ColumnName(idx) + "=[" + name + "]->[" + newName + "]"); + if (log.isLoggable(Level.FINE)) log.fine(getInventoryNo() + ": " + get_ColumnName(idx) + "=[" + name + "]->[" + newName + "]"); set_Value(idx, newName); //~ } catch (Exception e) {} } @@ -177,7 +177,7 @@ public class MIFixedAsset extends X_I_FixedAsset // Create/Set Product MProduct product = getCreateProduct(); - log.fine("product=" + product); + if (log.isLoggable(Level.FINE)) log.fine("product=" + product); if (getM_Product_ID() <= 0) { throw new FillMandatoryException(COLUMNNAME_M_Product_ID); } diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index 6f176f00ef..1ae6d88a4e 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -810,7 +810,7 @@ public class MInOut extends X_M_InOut implements DocAction .append("' WHERE M_InOut_ID=").append(getM_InOut_ID()); int noLine = DB.executeUpdate(sql.toString(), get_TrxName()); m_lines = null; - log.fine(processed + " - Lines=" + noLine); + if (log.isLoggable(Level.FINE)) log.fine(processed + " - Lines=" + noLine); } // setProcessed /** @@ -841,7 +841,7 @@ public class MInOut extends X_M_InOut implements DocAction + getAD_Client_ID() + " - " + DocBaseType); else { - log.fine("DocBaseType=" + DocBaseType + " - C_DocType_ID=" + C_DocType_ID); + if (log.isLoggable(Level.FINE)) log.fine("DocBaseType=" + DocBaseType + " - C_DocType_ID=" + C_DocType_ID); setC_DocType_ID (C_DocType_ID); boolean isSOTrx = MDocType.DOCBASETYPE_MaterialDelivery.equals(DocBaseType); setIsSOTrx (isSOTrx); @@ -921,7 +921,7 @@ public class MInOut extends X_M_InOut implements DocAction { if (!confirm.isProcessed()) // wait intil done { - log.fine("Unprocessed: " + confirm); + if (log.isLoggable(Level.FINE)) log.fine("Unprocessed: " + confirm); return; } havePick = true; @@ -1055,7 +1055,7 @@ public class MInOut extends X_M_InOut implements DocAction .append(" FROM M_InOut o WHERE ol.M_InOut_ID=o.M_InOut_ID) ") .append("WHERE M_InOut_ID=").append(getC_Order_ID()); int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Lines -> #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Lines -> #" + no); } return true; } // afterSave @@ -1291,7 +1291,7 @@ public class MInOut extends X_M_InOut implements DocAction if (sLine.getC_OrderLine_ID() != 0) { oLine = new MOrderLine (getCtx(), sLine.getC_OrderLine_ID(), get_TrxName()); - log.fine("OrderLine - Reserved=" + oLine.getQtyReserved() + if (log.isLoggable(Level.FINE)) log.fine("OrderLine - Reserved=" + oLine.getQtyReserved() + ", Delivered=" + oLine.getQtyDelivered()); if (isSOTrx()) QtySO = sLine.getMovementQty(); @@ -1527,7 +1527,7 @@ public class MInOut extends X_M_InOut implements DocAction return DocAction.STATUS_Invalid; } else - log.fine("OrderLine -> Reserved=" + oLine.getQtyReserved() + if (log.isLoggable(Level.FINE)) log.fine("OrderLine -> Reserved=" + oLine.getQtyReserved() + ", Delivered=" + oLine.getQtyReserved()); } // Update RMA Line Qty Delivered @@ -1779,7 +1779,7 @@ public class MInOut extends X_M_InOut implements DocAction } } - log.fine(dropShipment.toString()); + if (log.isLoggable(Level.FINE)) log.fine(dropShipment.toString()); dropShipment.setDocAction(DocAction.ACTION_Complete); // added AdempiereException by Zuhri @@ -1889,7 +1889,7 @@ public class MInOut extends X_M_InOut implements DocAction storage.getQtyOnHand()); ma.saveEx(); qtyToDeliver = qtyToDeliver.subtract(storage.getQtyOnHand()); - log.fine( ma + ", QtyToDeliver=" + qtyToDeliver); + if (log.isLoggable(Level.FINE)) log.fine( ma + ", QtyToDeliver=" + qtyToDeliver); } if (qtyToDeliver.signum() == 0) @@ -1903,7 +1903,7 @@ public class MInOut extends X_M_InOut implements DocAction int M_AttributeSetInstance_ID = asi.getM_AttributeSetInstance_ID(); MInOutLineMA ma = new MInOutLineMA (line, M_AttributeSetInstance_ID, qtyToDeliver); ma.saveEx(); - log.fine("##: " + ma); + if (log.isLoggable(Level.FINE)) log.fine("##: " + ma); } } // outgoing Trx } // attributeSetInstance @@ -1945,7 +1945,7 @@ public class MInOut extends X_M_InOut implements DocAction MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(getCtx(), getC_DocType_ID()); if (counterDT != null) { - log.fine(counterDT.toString()); + if (log.isLoggable(Level.FINE)) log.fine(counterDT.toString()); if (!counterDT.isCreateCounter() || !counterDT.isValid()) return null; C_DocTypeTarget_ID = counterDT.getCounter_C_DocType_ID(); @@ -1953,7 +1953,7 @@ public class MInOut extends X_M_InOut implements DocAction else // indirect { C_DocTypeTarget_ID = MDocTypeCounter.getCounterDocType_ID(getCtx(), getC_DocType_ID()); - log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); + if (log.isLoggable(Level.FINE)) log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); if (C_DocTypeTarget_ID <= 0) return null; } @@ -1996,7 +1996,7 @@ public class MInOut extends X_M_InOut implements DocAction counterLine.saveEx(get_TrxName()); } - log.fine(counter.toString()); + if (log.isLoggable(Level.FINE)) log.fine(counter.toString()); // Document Action if (counterDT != null) diff --git a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java index 1f261da4b0..d0716299f9 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutConfirm.java @@ -488,7 +488,7 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction continue; // MInOutLine oldLine = confirmLine.getLine(); - log.fine("Qty=" + differenceQty + ", Old=" + oldLine); + if (log.isLoggable(Level.FINE)) log.fine("Qty=" + differenceQty + ", Old=" + oldLine); // // Create Header if (split == null) diff --git a/org.adempiere.base/src/org/compiere/model/MInventory.java b/org.adempiere.base/src/org/compiere/model/MInventory.java index 49cab66966..f4453238ac 100644 --- a/org.adempiere.base/src/org/compiere/model/MInventory.java +++ b/org.adempiere.base/src/org/compiere/model/MInventory.java @@ -276,7 +276,7 @@ public class MInventory extends X_M_Inventory implements DocAction final String sql = "UPDATE M_InventoryLine SET Processed=? WHERE M_Inventory_ID=?"; int noLine = DB.executeUpdateEx(sql, new Object[]{processed, getM_Inventory_ID()}, get_TrxName()); m_lines = null; - log.fine("Processed=" + processed + " - Lines=" + noLine); + if (log.isLoggable(Level.FINE)) log.fine("Processed=" + processed + " - Lines=" + noLine); } // setProcessed @@ -438,7 +438,7 @@ public class MInventory extends X_M_Inventory implements DocAction MInventoryLineMA ma = mas[j]; BigDecimal QtyMA = ma.getMovementQty(); BigDecimal QtyNew = QtyMA.add(qtyDiff); - log.fine("Diff=" + qtyDiff + if (log.isLoggable(Level.FINE)) log.fine("Diff=" + qtyDiff + " - Instance OnHand=" + QtyMA + "->" + QtyNew); if (!MStorageOnHand.add(getCtx(), getM_Warehouse_ID(), @@ -622,7 +622,7 @@ public class MInventory extends X_M_Inventory implements DocAction qtyToDeliver); ma.saveEx(); qtyToDeliver = Env.ZERO; - log.fine( ma + ", QtyToDeliver=" + qtyToDeliver); + if (log.isLoggable(Level.FINE)) log.fine( ma + ", QtyToDeliver=" + qtyToDeliver); } else { @@ -631,7 +631,7 @@ public class MInventory extends X_M_Inventory implements DocAction storage.getQtyOnHand()); ma.saveEx(); qtyToDeliver = qtyToDeliver.subtract(storage.getQtyOnHand()); - log.fine( ma + ", QtyToDeliver=" + qtyToDeliver); + if (log.isLoggable(Level.FINE)) log.fine( ma + ", QtyToDeliver=" + qtyToDeliver); } if (qtyToDeliver.signum() == 0) break; @@ -646,7 +646,7 @@ public class MInventory extends X_M_Inventory implements DocAction MInventoryLineMA ma = new MInventoryLineMA (line, M_AttributeSetInstance_ID , qtyToDeliver); ma.saveEx(); - log.fine("##: " + ma); + if (log.isLoggable(Level.FINE)) log.fine("##: " + ma); } } // outgoing Trx diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index a5e09fea0a..4080e7e606 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -863,7 +863,7 @@ public class MInvoice extends X_C_Invoice implements DocAction int noTax = DB.executeUpdate(msgdb.toString(), get_TrxName()); m_lines = null; m_taxes = null; - log.fine(processed + " - Lines=" + noLine + ", Tax=" + noTax); + if (log.isLoggable(Level.FINE)) log.fine(processed + " - Lines=" + noLine + ", Tax=" + noTax); } // setProcessed /** @@ -874,7 +874,7 @@ public class MInvoice extends X_C_Invoice implements DocAction { MInvoicePaySchedule[] schedule = MInvoicePaySchedule.getInvoicePaySchedule (getCtx(), getC_Invoice_ID(), 0, get_TrxName()); - log.fine("#" + schedule.length); + if (log.isLoggable(Level.FINE)) log.fine("#" + schedule.length); if (schedule.length == 0) { setIsPayScheduleValid(false); @@ -1066,7 +1066,7 @@ public class MInvoice extends X_C_Invoice implements DocAction .append(" FROM C_Invoice o WHERE ol.C_Invoice_ID=o.C_Invoice_ID) ") .append("WHERE C_Invoice_ID=").append(getC_Invoice_ID()); int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Lines -> #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Lines -> #" + no); } return true; } // afterSave @@ -1148,7 +1148,7 @@ public class MInvoice extends X_C_Invoice implements DocAction change = test != isPaid(); if (change) setIsPaid(test); - log.fine("Paid=" + test + if (log.isLoggable(Level.FINE)) log.fine("Paid=" + test + " (" + alloc + "=" + total + ")"); } @@ -1493,7 +1493,7 @@ public class MInvoice extends X_C_Invoice implements DocAction { MInvoiceLine line = lines[i]; MProduct product = MProduct.get (getCtx(), line.getM_Product_ID()); - log.fine(product.getName()); + if (log.isLoggable(Level.FINE)) log.fine(product.getName()); // New Lines int lineNo = line.getLine (); @@ -1646,7 +1646,7 @@ public class MInvoice extends X_C_Invoice implements DocAction if (getC_PaymentTerm_ID() == 0) return false; MPaymentTerm pt = new MPaymentTerm(getCtx(), getC_PaymentTerm_ID(), null); - log.fine(pt.toString()); + if (log.isLoggable(Level.FINE)) log.fine(pt.toString()); int numSchema = pt.getSchedule(false).length; @@ -1893,7 +1893,7 @@ public class MInvoice extends X_C_Invoice implements DocAction else newCreditAmt = newCreditAmt.add(invAmt); // - log.fine("GrandTotal=" + getGrandTotal(true) + "(" + invAmt + if (log.isLoggable(Level.FINE)) log.fine("GrandTotal=" + getGrandTotal(true) + "(" + invAmt + ") BP Life=" + bp.getActualLifeTimeValue() + "->" + newLifeAmt + ", Credit=" + bp.getSO_CreditUsed() + "->" + newCreditAmt + ", Balance=" + bp.getTotalOpenBalance(false) + " -> " + newBalance); @@ -1903,7 +1903,7 @@ public class MInvoice extends X_C_Invoice implements DocAction else { newBalance = newBalance.subtract(invAmt); - log.fine("GrandTotal=" + getGrandTotal(true) + "(" + invAmt + if (log.isLoggable(Level.FINE)) log.fine("GrandTotal=" + getGrandTotal(true) + "(" + invAmt + ") Balance=" + bp.getTotalOpenBalance(false) + " -> " + newBalance); } bp.setTotalOpenBalance(newBalance); @@ -1948,7 +1948,7 @@ public class MInvoice extends X_C_Invoice implements DocAction newAmt = amt; else newAmt = newAmt.add(amt); - log.fine("GrandTotal=" + getGrandTotal(true) + "(" + amt + if (log.isLoggable(Level.FINE)) log.fine("GrandTotal=" + getGrandTotal(true) + "(" + amt + ") Project " + project.getName() + " - Invoiced=" + project.getInvoicedAmt() + "->" + newAmt); project.setInvoicedAmt(newAmt); @@ -2106,7 +2106,7 @@ public class MInvoice extends X_C_Invoice implements DocAction MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(getCtx(), getC_DocType_ID()); if (counterDT != null) { - log.fine(counterDT.toString()); + if (log.isLoggable(Level.FINE)) log.fine(counterDT.toString()); if (!counterDT.isCreateCounter() || !counterDT.isValid()) return null; C_DocTypeTarget_ID = counterDT.getCounter_C_DocType_ID(); @@ -2114,7 +2114,7 @@ public class MInvoice extends X_C_Invoice implements DocAction else // indirect { C_DocTypeTarget_ID = MDocTypeCounter.getCounterDocType_ID(getCtx(), getC_DocType_ID()); - log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); + if (log.isLoggable(Level.FINE)) log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); if (C_DocTypeTarget_ID <= 0) return null; } @@ -2144,7 +2144,7 @@ public class MInvoice extends X_C_Invoice implements DocAction counterLine.saveEx(get_TrxName()); } - log.fine(counter.toString()); + if (log.isLoggable(Level.FINE)) log.fine(counter.toString()); // Document Action if (counterDT != null) diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java b/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java index ed4d445d73..81bd5017b7 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceBatch.java @@ -135,7 +135,7 @@ public class MInvoiceBatch extends X_C_InvoiceBatch .append("' WHERE C_InvoiceBatch_ID=").append(getC_InvoiceBatch_ID()); int noLine = DB.executeUpdate("UPDATE C_InvoiceBatchLine " + set, get_TrxName()); m_lines = null; - log.fine(processed + " - Lines=" + noLine); + if (log.isLoggable(Level.FINE)) log.fine(processed + " - Lines=" + noLine); } // setProcessed } // MInvoiceBatch diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java index cd217292a8..33171970f1 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java @@ -352,7 +352,7 @@ public class MInvoiceLine extends X_C_InvoiceLine if (getM_Product_ID() == 0 || isDescription()) return; // - log.fine("M_PriceList_ID=" + M_PriceList_ID); + if (log.isLoggable(Level.FINE)) log.fine("M_PriceList_ID=" + M_PriceList_ID); m_productPricing = new MProductPricing (getM_Product_ID(), C_BPartner_ID, getQtyInvoiced(), m_IsSOTrx); m_productPricing.setM_PriceList_ID(M_PriceList_ID); @@ -482,15 +482,15 @@ public class MInvoiceLine extends X_C_InvoiceLine if (stdTax != null) { - log.fine("stdTax rate is " + stdTax.getRate()); - log.fine("invoiceTax rate is " + invoiceTax.getRate()); + if (log.isLoggable(Level.FINE)) log.fine("stdTax rate is " + stdTax.getRate()); + if (log.isLoggable(Level.FINE)) log.fine("invoiceTax rate is " + invoiceTax.getRate()); taxThisAmt = taxThisAmt.add(invoiceTax.calculateTax(bd, isTaxIncluded(), getPrecision())); taxStdAmt = taxStdAmt.add(stdTax.calculateTax(bd, isTaxIncluded(), getPrecision())); bd = bd.subtract(taxStdAmt).add(taxThisAmt); - log.fine("Price List includes Tax and Tax Changed on Invoice Line: New Tax Amt: " + if (log.isLoggable(Level.FINE)) log.fine("Price List includes Tax and Tax Changed on Invoice Line: New Tax Amt: " + taxThisAmt + " Standard Tax Amt: " + taxStdAmt + " Line Net Amt: " + bd); } } @@ -816,7 +816,7 @@ public class MInvoiceLine extends X_C_InvoiceLine */ protected boolean beforeSave (boolean newRecord) { - log.fine("New=" + newRecord); + if (log.isLoggable(Level.FINE)) log.fine("New=" + newRecord); if (newRecord && getParent().isComplete()) { log.saveError("ParentComplete", Msg.translate(getCtx(), "C_InvoiceLine")); return false; diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceSchedule.java b/org.adempiere.base/src/org/compiere/model/MInvoiceSchedule.java index 3f7705500a..9b8f251252 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceSchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceSchedule.java @@ -21,6 +21,7 @@ import java.sql.ResultSet; import java.sql.Timestamp; import java.util.Calendar; import java.util.Properties; +import java.util.logging.Level; import org.compiere.util.CCache; import org.compiere.util.TimeUtil; @@ -113,7 +114,7 @@ public class MInvoiceSchedule extends X_C_InvoiceSchedule if (cutoff.after(today)) cutoff.add(Calendar.DAY_OF_YEAR, -7); Timestamp cutoffDate = new Timestamp (cutoff.getTimeInMillis()); - log.fine("canInvoice - Date=" + xDate + " > Cutoff=" + cutoffDate + if (log.isLoggable(Level.FINE)) log.fine("canInvoice - Date=" + xDate + " > Cutoff=" + cutoffDate + " - " + xDate.after(cutoffDate)); if (xDate.after(cutoffDate)) return false; @@ -123,7 +124,7 @@ public class MInvoiceSchedule extends X_C_InvoiceSchedule if (invoice.after(today)) invoice.add(Calendar.DAY_OF_YEAR, -7); Timestamp invoiceDate = new Timestamp (invoice.getTimeInMillis()); - log.fine("canInvoice - Date=" + xDate + " > Invoice=" + invoiceDate + if (log.isLoggable(Level.FINE)) log.fine("canInvoice - Date=" + xDate + " > Invoice=" + invoiceDate + " - " + xDate.after(invoiceDate)); if (xDate.after(invoiceDate)) return false; @@ -141,7 +142,7 @@ public class MInvoiceSchedule extends X_C_InvoiceSchedule if (cutoff.after(today)) cutoff.add(Calendar.MONTH, -1); Timestamp cutoffDate = new Timestamp (cutoff.getTimeInMillis()); - log.fine("canInvoice - Date=" + xDate + " > Cutoff=" + cutoffDate + if (log.isLoggable(Level.FINE)) log.fine("canInvoice - Date=" + xDate + " > Cutoff=" + cutoffDate + " - " + xDate.after(cutoffDate)); if (xDate.after(cutoffDate)) return false; @@ -151,7 +152,7 @@ public class MInvoiceSchedule extends X_C_InvoiceSchedule if (invoice.after(today)) invoice.add(Calendar.MONTH, -1); Timestamp invoiceDate = new Timestamp (invoice.getTimeInMillis()); - log.fine("canInvoice - Date=" + xDate + " > Invoice=" + invoiceDate + if (log.isLoggable(Level.FINE)) log.fine("canInvoice - Date=" + xDate + " > Invoice=" + invoiceDate + " - " + xDate.after(invoiceDate)); if (xDate.after(invoiceDate)) return false; diff --git a/org.adempiere.base/src/org/compiere/model/MJournal.java b/org.adempiere.base/src/org/compiere/model/MJournal.java index d716cdfbd6..5724d07ff1 100644 --- a/org.adempiere.base/src/org/compiere/model/MJournal.java +++ b/org.adempiere.base/src/org/compiere/model/MJournal.java @@ -285,7 +285,7 @@ public class MJournal extends X_GL_Journal implements DocAction .append((processed ? "Y" : "N")) .append("' WHERE GL_Journal_ID=").append(getGL_Journal_ID()); int noLine = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine(processed + " - Lines=" + noLine); + if (log.isLoggable(Level.FINE)) log.fine(processed + " - Lines=" + noLine); } // setProcessed diff --git a/org.adempiere.base/src/org/compiere/model/MLanguage.java b/org.adempiere.base/src/org/compiere/model/MLanguage.java index b72c8203fb..8572d7f313 100644 --- a/org.adempiere.base/src/org/compiere/model/MLanguage.java +++ b/org.adempiere.base/src/org/compiere/model/MLanguage.java @@ -319,7 +319,7 @@ public class MLanguage extends X_AD_Language protected boolean afterSave (boolean newRecord, boolean success) { int no = TranslationTable.getActiveLanguages(true); - log.fine("Active Languages=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Active Languages=" + no); return true; } // afterSave @@ -368,7 +368,7 @@ public class MLanguage extends X_AD_Language { StringBuilder sql = new StringBuilder("DELETE FROM ").append(tableName).append(" WHERE AD_Language=?"); int no = DB.executeUpdateEx(sql.toString(), new Object[]{getAD_Language()}, get_TrxName()); - log.fine(tableName + " #" + no); + if (log.isLoggable(Level.FINE)) log.fine(tableName + " #" + no); return no; } // deleteTable @@ -442,7 +442,7 @@ public class MLanguage extends X_AD_Language UUIDGenerator.updateUUID(column, get_TrxName()); // StringBuilder msglog = new StringBuilder().append(tableName).append(" #").append(no); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); return no; } // addTable diff --git a/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java b/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java index 9bddcbeac2..be63e95c10 100644 --- a/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLocatorLookup.java @@ -82,7 +82,7 @@ public final class MLocatorLookup extends Lookup implements Serializable */ public void dispose() { - log.fine("C_Locator_ID=" + C_Locator_ID); + if (log.isLoggable(Level.FINE)) log.fine("C_Locator_ID=" + C_Locator_ID); if (m_loader != null) { while (m_loader.isAlive()) @@ -379,7 +379,7 @@ public final class MLocatorLookup extends Lookup implements Serializable DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("Complete #" + m_lookup.size()); + if (log.isLoggable(Level.FINE)) log.fine("Complete #" + m_lookup.size()); if (m_lookup.size() == 0) log.finer(finalSql); } // run diff --git a/org.adempiere.base/src/org/compiere/model/MLookup.java b/org.adempiere.base/src/org/compiere/model/MLookup.java index fa6f79f895..eecec83f60 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MLookup.java @@ -67,7 +67,7 @@ public final class MLookup extends Lookup implements Serializable { super(info.DisplayType, info.WindowNo); m_info = info; - log.fine(m_info.KeyColumn); + if (log.isLoggable(Level.FINE)) log.fine(m_info.KeyColumn); // load into local lookup, if already cached if (Ini.isClient()) @@ -135,7 +135,7 @@ public final class MLookup extends Lookup implements Serializable public void dispose() { if (m_info != null) - log.fine(m_info.KeyColumn + ": dispose"); + if (log.isLoggable(Level.FINE)) log.fine(m_info.KeyColumn + ": dispose"); if (m_loaderFuture != null && !m_loaderFuture.isDone()) m_loaderFuture.cancel(true); m_loader = null; @@ -365,7 +365,7 @@ public final class MLookup extends Lookup implements Serializable { if (m_loaderFuture != null && !m_loaderFuture.isDone()) { - log.fine((m_info.KeyColumn==null ? "ID="+m_info.Column_ID : m_info.KeyColumn) + if (log.isLoggable(Level.FINE)) log.fine((m_info.KeyColumn==null ? "ID="+m_info.Column_ID : m_info.KeyColumn) + ": waiting for Loader"); loadComplete(); } @@ -385,7 +385,7 @@ public final class MLookup extends Lookup implements Serializable if (!validated && onlyValidated) { loadData (loadParent); - log.fine(m_info.KeyColumn + ": Validated - #" + m_lookup.size()); + if (log.isLoggable(Level.FINE)) log.fine(m_info.KeyColumn + ": Validated - #" + m_lookup.size()); } return new ArrayList(m_lookup.values()); @@ -644,12 +644,12 @@ public final class MLookup extends Lookup implements Serializable if (m_info.DisplayType == DisplayType.Search || m_info.IsCreadedUpdatedBy) return 0; - log.fine(m_info.KeyColumn + ": start"); + if (log.isLoggable(Level.FINE)) log.fine(m_info.KeyColumn + ": start"); m_loader = new MLoader(); m_loaderFuture = Adempiere.getThreadPoolExecutor().submit(m_loader); loadComplete(); - log.fine(m_info.KeyColumn + ": #" + m_lookup.size()); + if (log.isLoggable(Level.FINE)) log.fine(m_info.KeyColumn + ": #" + m_lookup.size()); return m_lookup.size(); } // refresh @@ -724,7 +724,7 @@ public final class MLookup extends Lookup implements Serializable m_info.parsedValidationCode = validation; if (validation.length() == 0 && m_info.ValidationCode.length() > 0) { - log.fine(m_info.KeyColumn + ": Loader NOT Validated: " + m_info.ValidationCode); + if (log.isLoggable(Level.FINE)) log.fine(m_info.KeyColumn + ": Loader NOT Validated: " + m_info.ValidationCode); // Bug 1843862 - Lookups not working on Report Viewer window // globalqss - when called from Viewer window ignore error about not parseable context variables // there is no context in report viewer windows @@ -736,7 +736,7 @@ public final class MLookup extends Lookup implements Serializable } else { - log.fine(m_info.KeyColumn + ": Loader Validated: " + validation); + if (log.isLoggable(Level.FINE)) log.fine(m_info.KeyColumn + ": Loader Validated: " + validation); int posFrom = sql.lastIndexOf(" FROM "); boolean hasWhere = sql.indexOf(" WHERE ", posFrom) != -1; // @@ -750,7 +750,7 @@ public final class MLookup extends Lookup implements Serializable sql.append((hasWhere ? " AND " : " WHERE ")) .append(validation); if (CLogMgt.isLevelFinest()) - log.fine(m_info.KeyColumn + ": Validation=" + validation); + if (log.isLoggable(Level.FINE)) log.fine(m_info.KeyColumn + ": Validation=" + validation); } } // check @@ -831,7 +831,7 @@ public final class MLookup extends Lookup implements Serializable ValueNamePair p = new ValueNamePair(value, name.toString()); m_lookup.put(value, p); } - // log.fine( m_info.KeyColumn + ": " + name); + // if (log.isLoggable(Level.FINE)) log.fine( m_info.KeyColumn + ": " + name); } } catch (SQLException e) diff --git a/org.adempiere.base/src/org/compiere/model/MMeasure.java b/org.adempiere.base/src/org/compiere/model/MMeasure.java index 1bf09fe1e1..2210fc5f4e 100644 --- a/org.adempiere.base/src/org/compiere/model/MMeasure.java +++ b/org.adempiere.base/src/org/compiere/model/MMeasure.java @@ -475,7 +475,7 @@ public class MMeasure extends X_PA_Measure if (ManualActual == null) { ManualActual = Env.ZERO; - log.fine("No Value = " + sql); + if (log.isLoggable(Level.FINE)) log.fine("No Value = " + sql); } goal.setMeasureActual(ManualActual); goal.saveEx(get_TrxName()); @@ -529,7 +529,7 @@ public class MMeasure extends X_PA_Measure if (ManualActual == null) { ManualActual = Env.ZERO; - log.fine("No Value = " + sql); + if (log.isLoggable(Level.FINE)) log.fine("No Value = " + sql); } goal.setMeasureActual(ManualActual); goal.saveEx(get_TrxName()); @@ -572,7 +572,7 @@ public class MMeasure extends X_PA_Measure if (ManualActual == null) { ManualActual = Env.ZERO; - log.fine("No Value = " + sql); + if (log.isLoggable(Level.FINE)) log.fine("No Value = " + sql); } goal.setMeasureActual(ManualActual); goal.saveEx(get_TrxName()); diff --git a/org.adempiere.base/src/org/compiere/model/MMedia.java b/org.adempiere.base/src/org/compiere/model/MMedia.java index 1dcf01f089..f21d30181f 100644 --- a/org.adempiere.base/src/org/compiere/model/MMedia.java +++ b/org.adempiere.base/src/org/compiere/model/MMedia.java @@ -165,7 +165,7 @@ public class MMedia extends X_CM_Media .append(", 0, 999)"); int no = DB.executeUpdate(sb.toString(), get_TrxName()); if (no > 0) - log.fine("#" + no + " - TreeType=CMM"); + if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMM"); else log.warning("#" + no + " - TreeType=CMM"); return no > 0; @@ -188,7 +188,7 @@ public class MMedia extends X_CM_Media .append(" AND AD_Tree_ID=").append(getAD_Tree_ID()); int no = DB.executeUpdate(sb.toString(), get_TrxName()); if (no > 0) - log.fine("#" + no + " - TreeType=CMM"); + if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=CMM"); else log.warning("#" + no + " - TreeType=CMM"); return no > 0; diff --git a/org.adempiere.base/src/org/compiere/model/MMovement.java b/org.adempiere.base/src/org/compiere/model/MMovement.java index 42cf23b83a..e02f9423a7 100644 --- a/org.adempiere.base/src/org/compiere/model/MMovement.java +++ b/org.adempiere.base/src/org/compiere/model/MMovement.java @@ -222,7 +222,7 @@ public class MMovement extends X_M_Movement implements DocAction final String sql = "UPDATE M_MovementLine SET Processed=? WHERE M_Movement_ID=?"; int noLine = DB.executeUpdateEx(sql, new Object[]{processed, get_ID()}, get_TrxName()); m_lines = null; - log.fine("Processed=" + processed + " - Lines=" + noLine); + if (log.isLoggable(Level.FINE)) log.fine("Processed=" + processed + " - Lines=" + noLine); } // setProcessed @@ -570,7 +570,7 @@ public class MMovement extends X_M_Movement implements DocAction qtyToDeliver); ma.saveEx(); qtyToDeliver = Env.ZERO; - log.fine( ma + ", QtyToDeliver=" + qtyToDeliver); + if (log.isLoggable(Level.FINE)) log.fine( ma + ", QtyToDeliver=" + qtyToDeliver); } else { @@ -579,7 +579,7 @@ public class MMovement extends X_M_Movement implements DocAction storage.getQtyOnHand()); ma.saveEx(); qtyToDeliver = qtyToDeliver.subtract(storage.getQtyOnHand()); - log.fine( ma + ", QtyToDeliver=" + qtyToDeliver); + if (log.isLoggable(Level.FINE)) log.fine( ma + ", QtyToDeliver=" + qtyToDeliver); } if (qtyToDeliver.signum() == 0) break; @@ -593,7 +593,7 @@ public class MMovement extends X_M_Movement implements DocAction int M_AttributeSetInstance_ID = asi.getM_AttributeSetInstance_ID(); MMovementLineMA ma = new MMovementLineMA (line, M_AttributeSetInstance_ID , qtyToDeliver); ma.saveEx(); - log.fine("##: " + ma); + if (log.isLoggable(Level.FINE)) log.fine("##: " + ma); } } // attributeSetInstance diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index a44195c84a..064edb850a 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -394,7 +394,7 @@ public class MOrder extends X_C_Order implements DocAction log.severe ("Not found for AD_Client_ID=" + getAD_Client_ID () + ", SubType=" + DocSubTypeSO_x); else { - log.fine("(SO) - " + DocSubTypeSO_x); + if (log.isLoggable(Level.FINE)) log.fine("(SO) - " + DocSubTypeSO_x); setC_DocTypeTarget_ID (C_DocType_ID); setIsSOTrx(true); } @@ -421,7 +421,7 @@ public class MOrder extends X_C_Order implements DocAction log.severe ("No POO found for AD_Client_ID=" + getAD_Client_ID ()); else { - log.fine("(PO) - " + C_DocType_ID); + if (log.isLoggable(Level.FINE)) log.fine("(PO) - " + C_DocType_ID); setC_DocTypeTarget_ID (C_DocType_ID); } } // setC_DocTypeTarget_ID @@ -876,7 +876,7 @@ public class MOrder extends X_C_Order implements DocAction int noTax = DB.executeUpdateEx("UPDATE C_OrderTax " + set, get_TrxName()); m_lines = null; m_taxes = null; - log.fine("setProcessed - " + processed + " - Lines=" + noLine + ", Tax=" + noTax); + if (log.isLoggable(Level.FINE)) log.fine("setProcessed - " + processed + " - Lines=" + noLine + ", Tax=" + noTax); } // setProcessed @@ -889,7 +889,7 @@ public class MOrder extends X_C_Order implements DocAction { MOrderPaySchedule[] schedule = MOrderPaySchedule.getOrderPaySchedule (getCtx(), getC_Order_ID(), 0, get_TrxName()); - log.fine("#" + schedule.length); + if (log.isLoggable(Level.FINE)) log.fine("#" + schedule.length); if (schedule.length == 0) { setIsPayScheduleValid(false); @@ -1094,7 +1094,7 @@ public class MOrder extends X_C_Order implements DocAction + "FROM C_Order o WHERE i.C_Order_ID=o.C_Order_ID) " + "WHERE DocStatus NOT IN ('RE','CL') AND C_Order_ID=" + getC_Order_ID(); int no = DB.executeUpdateEx(sql, get_TrxName()); - log.fine("Description -> #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Description -> #" + no); } // Propagate Changes of Payment Info to existing (not reversed/closed) invoices @@ -1109,7 +1109,7 @@ public class MOrder extends X_C_Order implements DocAction + "WHERE DocStatus NOT IN ('RE','CL') AND C_Order_ID=" + getC_Order_ID(); // Don't touch Closed/Reversed entries int no = DB.executeUpdate(sql, get_TrxName()); - log.fine("Payment -> #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Payment -> #" + no); } // Propagate Changes of Date Account to existing (not completed/reversed/closed) invoices @@ -1122,7 +1122,7 @@ public class MOrder extends X_C_Order implements DocAction + "WHERE DocStatus NOT IN ('CO','RE','CL') AND Processed='N' AND C_Order_ID=" + getC_Order_ID(); // Don't touch Completed/Closed/Reversed entries int no = DB.executeUpdate(sql, get_TrxName()); - log.fine("DateAcct -> #" + no); + if (log.isLoggable(Level.FINE)) log.fine("DateAcct -> #" + no); } // Sync Lines @@ -1577,7 +1577,7 @@ public class MOrder extends X_C_Order implements DocAction { MOrderLine line = lines[i]; MProduct product = MProduct.get (getCtx(), line.getM_Product_ID()); - log.fine(product.getName()); + if (log.isLoggable(Level.FINE)) log.fine(product.getName()); // New Lines int lineNo = line.getLine (); //find default BOM with valid dates and to this product @@ -1673,7 +1673,7 @@ public class MOrder extends X_C_Order implements DocAction ) // || isDropShip() ) binding = false; boolean isSOTrx = isSOTrx(); - log.fine("Binding=" + binding + " - IsSOTrx=" + isSOTrx); + if (log.isLoggable(Level.FINE)) log.fine("Binding=" + binding + " - IsSOTrx=" + isSOTrx); // Force same WH for all but SO/PO int header_M_Warehouse_ID = getM_Warehouse_ID(); if (MDocType.DOCSUBTYPESO_StandardOrder.equals(dt.getDocSubTypeSO()) @@ -1711,7 +1711,7 @@ public class MOrder extends X_C_Order implements DocAction continue; } - log.fine("Line=" + line.getLine() + if (log.isLoggable(Level.FINE)) log.fine("Line=" + line.getLine() + " - Target=" + target + ",Difference=" + difference + " - Ordered=" + line.getQtyOrdered() + ",Reserved=" + line.getQtyReserved() + ",Delivered=" + line.getQtyDelivered()); @@ -1833,7 +1833,7 @@ public class MOrder extends X_C_Order implements DocAction if (getC_PaymentTerm_ID() == 0) return false; MPaymentTerm pt = new MPaymentTerm(getCtx(), getC_PaymentTerm_ID(), null); - log.fine(pt.toString()); + if (log.isLoggable(Level.FINE)) log.fine(pt.toString()); int numSchema = pt.getSchedule(false).length; @@ -2335,7 +2335,7 @@ public class MOrder extends X_C_Order implements DocAction MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(getCtx(), getC_DocType_ID()); if (counterDT != null) { - log.fine(counterDT.toString()); + if (log.isLoggable(Level.FINE)) log.fine(counterDT.toString()); if (!counterDT.isCreateCounter() || !counterDT.isValid()) return null; C_DocTypeTarget_ID = counterDT.getCounter_C_DocType_ID(); @@ -2343,7 +2343,7 @@ public class MOrder extends X_C_Order implements DocAction else // indirect { C_DocTypeTarget_ID = MDocTypeCounter.getCounterDocType_ID(getCtx(), getC_DocType_ID()); - log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); + if (log.isLoggable(Level.FINE)) log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); if (C_DocTypeTarget_ID <= 0) return null; } @@ -2370,7 +2370,7 @@ public class MOrder extends X_C_Order implements DocAction counterLine.setTax(); counterLine.saveEx(get_TrxName()); } - log.fine(counter.toString()); + if (log.isLoggable(Level.FINE)) log.fine(counter.toString()); // Document Action if (counterDT != null) diff --git a/org.adempiere.base/src/org/compiere/model/MOrderLine.java b/org.adempiere.base/src/org/compiere/model/MOrderLine.java index a08322ab67..33104db73d 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderLine.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderLine.java @@ -295,7 +295,7 @@ public class MOrderLine extends X_C_OrderLine if (getM_Product_ID() == 0) return; // - log.fine(toString() + " - M_PriceList_ID=" + M_PriceList_ID); + if (log.isLoggable(Level.FINE)) log.fine(toString() + " - M_PriceList_ID=" + M_PriceList_ID); getProductPricing (M_PriceList_ID); setPriceActual (m_productPrice.getPriceStd()); setPriceList (m_productPrice.getPriceList()); @@ -384,15 +384,17 @@ public class MOrderLine extends X_C_OrderLine if (stdTax != null) { - log.fine("stdTax rate is " + stdTax.getRate()); - log.fine("orderTax rate is " + orderTax.getRate()); - + if (log.isLoggable(Level.FINE)){ + log.fine("stdTax rate is " + stdTax.getRate()); + log.fine("orderTax rate is " + orderTax.getRate()); + } + taxThisAmt = taxThisAmt.add(orderTax.calculateTax(bd, isTaxIncluded(), getPrecision())); taxStdAmt = taxStdAmt.add(stdTax.calculateTax(bd, isTaxIncluded(), getPrecision())); bd = bd.subtract(taxStdAmt).add(taxThisAmt); - log.fine("Price List includes Tax and Tax Changed on Order Line: New Tax Amt: " + if (log.isLoggable(Level.FINE)) log.fine("Price List includes Tax and Tax Changed on Order Line: New Tax Amt: " + taxThisAmt + " Standard Tax Amt: " + taxStdAmt + " Line Net Amt: " + bd); } diff --git a/org.adempiere.base/src/org/compiere/model/MOrderTax.java b/org.adempiere.base/src/org/compiere/model/MOrderTax.java index c0cd6a0d88..c5791b368c 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrderTax.java +++ b/org.adempiere.base/src/org/compiere/model/MOrderTax.java @@ -247,7 +247,7 @@ public class MOrderTax extends X_C_OrderTax setTaxBaseAmt (taxBaseAmt.subtract(taxAmt)); else setTaxBaseAmt (taxBaseAmt); - log.fine(toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString()); return true; } // calculateTaxFromLines diff --git a/org.adempiere.base/src/org/compiere/model/MPInstance.java b/org.adempiere.base/src/org/compiere/model/MPInstance.java index ccd31d089b..3d6c438fb9 100644 --- a/org.adempiere.base/src/org/compiere/model/MPInstance.java +++ b/org.adempiere.base/src/org/compiere/model/MPInstance.java @@ -299,7 +299,7 @@ public class MPInstance extends X_AD_PInstance String updsql = "UPDATE AD_Process SET Statistic_Count=Statistic_Count+1, Statistic_Seconds=Statistic_Seconds+? WHERE AD_Process_ID=?"; int no = DB.executeUpdate(updsql, new Object[] {seconds, getAD_Process_ID()}, true, null); // out of trx if (no == 1) - log.fine("afterSave - Process Statistics updated Sec=" + seconds); + if (log.isLoggable(Level.FINE)) log.fine("afterSave - Process Statistics updated Sec=" + seconds); else log.warning("afterSave - Process Statistics not updated"); } diff --git a/org.adempiere.base/src/org/compiere/model/MPOS.java b/org.adempiere.base/src/org/compiere/model/MPOS.java index 6118a68fd0..7e74c55b7e 100644 --- a/org.adempiere.base/src/org/compiere/model/MPOS.java +++ b/org.adempiere.base/src/org/compiere/model/MPOS.java @@ -19,6 +19,8 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; import java.util.List; +import java.util.logging.Level; + import org.compiere.util.CCache; import org.compiere.util.Msg; @@ -150,7 +152,7 @@ public class MPOS extends X_C_POS m_template = MBPartner.getBPartnerCashTrx (getCtx(), getAD_Client_ID()); else m_template = new MBPartner(getCtx(), getC_BPartnerCashTrx_ID(), get_TrxName()); - log.fine("getBPartner - " + m_template); + if (log.isLoggable(Level.FINE)) log.fine("getBPartner - " + m_template); } return m_template; } // getBPartner diff --git a/org.adempiere.base/src/org/compiere/model/MPayment.java b/org.adempiere.base/src/org/compiere/model/MPayment.java index ed2d8b8f0e..95a5a89d90 100644 --- a/org.adempiere.base/src/org/compiere/model/MPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPayment.java @@ -826,7 +826,7 @@ public final class MPayment extends X_C_Payment boolean change = test != isAllocated(); if (change) setIsAllocated(test); - log.fine("Allocated=" + test + if (log.isLoggable(Level.FINE)) log.fine("Allocated=" + test + " (" + alloc + "=" + total + ")"); return change; } // testAllocation @@ -1002,7 +1002,7 @@ public final class MPayment extends X_C_Payment // ValueNamePair[] retValue = new ValueNamePair[map.size ()]; map.values ().toArray (retValue); - log.fine("getCreditCards - #" + retValue.length + " - Processors=" + m_mBankAccountProcessors.length); + if (log.isLoggable(Level.FINE)) log.fine("getCreditCards - #" + retValue.length + " - Processors=" + m_mBankAccountProcessors.length); return retValue; } catch (Exception ex) @@ -1297,7 +1297,7 @@ public final class MPayment extends X_C_Payment */ public void setBP_BankAccount (MBPBankAccount ba) { - log.fine("" + ba); + if (log.isLoggable(Level.FINE)) log.fine("" + ba); if (ba == null) return; setC_BPartner_ID(ba.getC_BPartner_ID()); @@ -1358,7 +1358,7 @@ public final class MPayment extends X_C_Payment ba.setR_AvsZip(getR_AvsZip()); // boolean ok = ba.save(get_TrxName()); - log.fine("saveToBP_BankAccount - " + ba); + if (log.isLoggable(Level.FINE)) log.fine("saveToBP_BankAccount - " + ba); return ok; } // setBP_BankAccount @@ -2065,7 +2065,7 @@ public final class MPayment extends X_C_Payment MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(getCtx(), getC_DocType_ID()); if (counterDT != null) { - log.fine(counterDT.toString()); + if (log.isLoggable(Level.FINE)) log.fine(counterDT.toString()); if (!counterDT.isCreateCounter() || !counterDT.isValid()) return null; C_DocTypeTarget_ID = counterDT.getCounter_C_DocType_ID(); @@ -2073,7 +2073,7 @@ public final class MPayment extends X_C_Payment else // indirect { C_DocTypeTarget_ID = MDocTypeCounter.getCounterDocType_ID(getCtx(), getC_DocType_ID()); - log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); + if (log.isLoggable(Level.FINE)) log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); if (C_DocTypeTarget_ID <= 0) return null; } @@ -2113,7 +2113,7 @@ public final class MPayment extends X_C_Payment counter.setUser1_ID(getUser1_ID()); counter.setUser2_ID(getUser2_ID()); counter.saveEx(get_TrxName()); - log.fine(counter.toString()); + if (log.isLoggable(Level.FINE)) log.fine(counter.toString()); setRef_Payment_ID(counter.getC_Payment_ID()); // Document Action @@ -2313,7 +2313,7 @@ public final class MPayment extends X_C_Payment boolean ok = true; if (alloc.get_ID() == 0) { - log.fine("No Allocation created - C_Payment_ID=" + if (log.isLoggable(Level.FINE)) log.fine("No Allocation created - C_Payment_ID=" + getC_Payment_ID()); ok = false; } @@ -2344,7 +2344,7 @@ public final class MPayment extends X_C_Payment // De-Allocate all MAllocationHdr[] allocations = MAllocationHdr.getOfPayment(getCtx(), getC_Payment_ID(), get_TrxName()); - log.fine("#" + allocations.length); + if (log.isLoggable(Level.FINE)) log.fine("#" + allocations.length); for (int i = 0; i < allocations.length; i++) { allocations[i].set_TrxName(get_TrxName()); @@ -2373,7 +2373,7 @@ public final class MPayment extends X_C_Payment + " AND C_Payment_ID=" + getC_Payment_ID(); int no = DB.executeUpdate(sql, get_TrxName()); if (no != 0) - log.fine("Unlink Invoice #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Unlink Invoice #" + no); // Order sql = "UPDATE C_Order o " + "SET C_Payment_ID = NULL " @@ -2382,7 +2382,7 @@ public final class MPayment extends X_C_Payment + " AND C_Payment_ID=" + getC_Payment_ID(); no = DB.executeUpdate(sql, get_TrxName()); if (no != 0) - log.fine("Unlink Order #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Unlink Order #" + no); } // setC_Invoice_ID(0); diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java b/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java index f56131ac13..afcbf43418 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentLookup.java @@ -187,7 +187,7 @@ public class MPaymentLookup extends Lookup implements Serializable { log.severe(getColumnName() + " - Cannot Parse=" + whereClause); else { - log.fine(getColumnName() + " - Parsed: " + validated); + if (log.isLoggable(Level.FINE)) log.fine(getColumnName() + " - Parsed: " + validated); return validated; } } diff --git a/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java b/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java index e964bf2ae6..03ae3347ff 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java +++ b/org.adempiere.base/src/org/compiere/model/MPaymentTerm.java @@ -251,7 +251,7 @@ public class MPaymentTerm extends X_C_PaymentTerm { ips = new MInvoicePaySchedule (invoice, m_schedule[i]); ips.save(invoice.get_TrxName()); - log.fine(ips.toString()); + if (log.isLoggable(Level.FINE)) log.fine(ips.toString()); remainder = remainder.subtract(ips.getDueAmt()); } // for all schedules // Remainder - update last @@ -259,7 +259,7 @@ public class MPaymentTerm extends X_C_PaymentTerm { ips.setDueAmt(ips.getDueAmt().add(remainder)); ips.save(invoice.get_TrxName()); - log.fine("Remainder=" + remainder + " - " + ips); + if (log.isLoggable(Level.FINE)) log.fine("Remainder=" + remainder + " - " + ips); } // updateInvoice @@ -277,7 +277,7 @@ public class MPaymentTerm extends X_C_PaymentTerm { String sql = "DELETE C_InvoicePaySchedule WHERE C_Invoice_ID=" + C_Invoice_ID; int no = DB.executeUpdate(sql, trxName); - log.fine("C_Invoice_ID=" + C_Invoice_ID + " - #" + no); + if (log.isLoggable(Level.FINE)) log.fine("C_Invoice_ID=" + C_Invoice_ID + " - #" + no); } // deleteInvoicePaySchedule @@ -356,7 +356,7 @@ public class MPaymentTerm extends X_C_PaymentTerm { ops = new MOrderPaySchedule (order, m_schedule[i]); ops.save(order.get_TrxName()); - log.fine(ops.toString()); + if (log.isLoggable(Level.FINE)) log.fine(ops.toString()); remainder = remainder.subtract(ops.getDueAmt()); } // for all schedules // Remainder - update last @@ -364,7 +364,7 @@ public class MPaymentTerm extends X_C_PaymentTerm { ops.setDueAmt(ops.getDueAmt().add(remainder)); ops.save(order.get_TrxName()); - log.fine("Remainder=" + remainder + " - " + ops); + if (log.isLoggable(Level.FINE)) log.fine("Remainder=" + remainder + " - " + ops); } // updateOrder @@ -382,7 +382,7 @@ public class MPaymentTerm extends X_C_PaymentTerm { String sql = "DELETE C_OrderPaySchedule WHERE C_Order_ID=" + C_Order_ID; int no = DB.executeUpdate(sql, trxName); - log.fine("C_Order_ID=" + C_Order_ID + " - #" + no); + if (log.isLoggable(Level.FINE)) log.fine("C_Order_ID=" + C_Order_ID + " - #" + no); } // deleteOrderPaySchedule diff --git a/org.adempiere.base/src/org/compiere/model/MPeriod.java b/org.adempiere.base/src/org/compiere/model/MPeriod.java index b884f2de1f..83241110d0 100644 --- a/org.adempiere.base/src/org/compiere/model/MPeriod.java +++ b/org.adempiere.base/src/org/compiere/model/MPeriod.java @@ -537,7 +537,7 @@ public class MPeriod extends X_C_Period log.warning(getName() + " - Period Control not found for " + DocBaseType); return false; } - log.fine(getName() + ": " + DocBaseType); + if (log.isLoggable(Level.FINE)) log.fine(getName() + ": " + DocBaseType); return pc.isOpen(); } // isOpen @@ -630,7 +630,7 @@ public class MPeriod extends X_C_Period count++; baseTypes.add (DocBaseType); } - log.fine("PeriodControl #" + count); + if (log.isLoggable(Level.FINE)) log.fine("PeriodControl #" + count); } return success; } // afterSave diff --git a/org.adempiere.base/src/org/compiere/model/MPriceList.java b/org.adempiere.base/src/org/compiere/model/MPriceList.java index 6f8de4330f..d72eb6732e 100644 --- a/org.adempiere.base/src/org/compiere/model/MPriceList.java +++ b/org.adempiere.base/src/org/compiere/model/MPriceList.java @@ -20,6 +20,7 @@ import java.sql.ResultSet; import java.sql.Timestamp; import java.util.Iterator; import java.util.Properties; +import java.util.logging.Level; import org.compiere.util.CCache; import org.compiere.util.Env; @@ -252,7 +253,7 @@ public class MPriceList extends X_M_PriceList if (m_plv == null) log.warning("None found M_PriceList_ID=" + getM_PriceList_ID() + " - " + valid); else - log.fine(m_plv.toString()); + if (log.isLoggable(Level.FINE)) log.fine(m_plv.toString()); return m_plv; } // getPriceListVersion diff --git a/org.adempiere.base/src/org/compiere/model/MProcessPara.java b/org.adempiere.base/src/org/compiere/model/MProcessPara.java index 914b3ef7b2..0e5eefb9c6 100644 --- a/org.adempiere.base/src/org/compiere/model/MProcessPara.java +++ b/org.adempiere.base/src/org/compiere/model/MProcessPara.java @@ -144,7 +144,7 @@ public class MProcessPara extends X_AD_Process_Para { if (!isLookup()) return; - log.fine("(" + getColumnName() + ")"); + if (log.isLoggable(Level.FINE)) log.fine("(" + getColumnName() + ")"); int displayType = getAD_Reference_ID(); if (DisplayType.isLookup(displayType)) { diff --git a/org.adempiere.base/src/org/compiere/model/MProduct.java b/org.adempiere.base/src/org/compiere/model/MProduct.java index c0b092b402..4b2599318a 100644 --- a/org.adempiere.base/src/org/compiere/model/MProduct.java +++ b/org.adempiere.base/src/org/compiere/model/MProduct.java @@ -20,6 +20,7 @@ import java.math.BigDecimal; import java.sql.ResultSet; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; import org.compiere.util.CCache; @@ -693,7 +694,7 @@ public class MProduct extends X_M_Product // + " AND GuaranteeDate > SysDate" + " AND M_Product_ID=" + getM_Product_ID(); int no = DB.executeUpdate(sql, get_TrxName()); - log.fine("Asset Description updated #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Asset Description updated #" + no); } // New - Acct, Tree, Old Costing diff --git a/org.adempiere.base/src/org/compiere/model/MProductPricing.java b/org.adempiere.base/src/org/compiere/model/MProductPricing.java index 4a045f3e5a..76e8345aeb 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductPricing.java +++ b/org.adempiere.base/src/org/compiere/model/MProductPricing.java @@ -190,7 +190,7 @@ public class MProductPricing m_enforcePriceLimit = "Y".equals(rs.getString(8)); m_isTaxIncluded = "Y".equals(rs.getString(9)); // - log.fine("M_PriceList_Version_ID=" + m_M_PriceList_Version_ID + " - " + m_PriceStd); + if (log.isLoggable(Level.FINE)) log.fine("M_PriceList_Version_ID=" + m_M_PriceList_Version_ID + " - " + m_PriceStd); m_calculated = true; } } @@ -313,7 +313,7 @@ public class MProductPricing m_M_Product_Category_ID = rs.getInt(7); m_enforcePriceLimit = "Y".equals(rs.getString(8)); // - log.fine("M_PriceList_ID=" + m_M_PriceList_ID + if (log.isLoggable(Level.FINE)) log.fine("M_PriceList_ID=" + m_M_PriceList_ID + "(" + plDate + ")" + " - " + m_PriceStd); m_calculated = true; break; @@ -395,7 +395,7 @@ public class MProductPricing m_enforcePriceLimit = "Y".equals(rs.getString(8)); m_isTaxIncluded = "Y".equals(rs.getString(9)); // - log.fine("M_PriceList_ID=" + m_M_PriceList_ID + if (log.isLoggable(Level.FINE)) log.fine("M_PriceList_ID=" + m_M_PriceList_ID + "(" + plDate + ")" + " - " + m_PriceStd); m_calculated = true; break; @@ -473,7 +473,7 @@ public class MProductPricing m_enforcePriceLimit = "Y".equals(rs.getString(8)); m_isTaxIncluded = "Y".equals(rs.getString(9)); // - log.fine("M_PriceList_Version_ID=" + m_M_PriceList_Version_ID + " - " + m_PriceStd); + if (log.isLoggable(Level.FINE)) log.fine("M_PriceList_Version_ID=" + m_M_PriceList_Version_ID + " - " + m_PriceStd); m_calculated = true; } } @@ -600,7 +600,7 @@ public class MProductPricing m_M_Product_Category_ID = rs.getInt(7); m_enforcePriceLimit = "Y".equals(rs.getString(8)); // - log.fine("M_PriceList_ID=" + m_M_PriceList_ID + if (log.isLoggable(Level.FINE)) log.fine("M_PriceList_ID=" + m_M_PriceList_ID + "(" + plDate + ")" + " - " + m_PriceStd); m_calculated = true; break; @@ -686,7 +686,7 @@ public class MProductPricing m_enforcePriceLimit = "Y".equals(rs.getString(8)); m_isTaxIncluded = "Y".equals(rs.getString(9)); // - log.fine("M_PriceList_ID=" + m_M_PriceList_ID + if (log.isLoggable(Level.FINE)) log.fine("M_PriceList_ID=" + m_M_PriceList_ID + "(" + plDate + ")" + " - " + m_PriceStd); m_calculated = true; break; diff --git a/org.adempiere.base/src/org/compiere/model/MProject.java b/org.adempiere.base/src/org/compiere/model/MProject.java index b649473ff6..6cdf7eb790 100644 --- a/org.adempiere.base/src/org/compiere/model/MProject.java +++ b/org.adempiere.base/src/org/compiere/model/MProject.java @@ -393,7 +393,7 @@ public class MProject extends X_C_Project taskCount += toPhase.copyTasksFrom(typePhases[i]); } } - log.fine("#" + count + "/" + taskCount + if (log.isLoggable(Level.FINE)) log.fine("#" + count + "/" + taskCount + " - " + type); if (typePhases.length != count) log.log(Level.SEVERE, "Count difference - Type=" + typePhases.length + " <> Saved=" + count); diff --git a/org.adempiere.base/src/org/compiere/model/MProjectPhase.java b/org.adempiere.base/src/org/compiere/model/MProjectPhase.java index 730b5e4fe7..240b97aa8b 100644 --- a/org.adempiere.base/src/org/compiere/model/MProjectPhase.java +++ b/org.adempiere.base/src/org/compiere/model/MProjectPhase.java @@ -241,7 +241,7 @@ public class MProjectPhase extends X_C_ProjectPhase if (toTask.save()) count++; } - log.fine("#" + count + " - " + fromPhase); + if (log.isLoggable(Level.FINE)) log.fine("#" + count + " - " + fromPhase); if (fromTasks.length != count) log.log(Level.SEVERE, "Count difference - TypePhase=" + fromTasks.length + " <> Saved=" + count); diff --git a/org.adempiere.base/src/org/compiere/model/MRMA.java b/org.adempiere.base/src/org/compiere/model/MRMA.java index 56e23ed5a6..bc311100b4 100644 --- a/org.adempiere.base/src/org/compiere/model/MRMA.java +++ b/org.adempiere.base/src/org/compiere/model/MRMA.java @@ -564,7 +564,7 @@ public class MRMA extends X_M_RMA implements DocAction MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(getCtx(), getC_DocType_ID()); if (counterDT != null) { - log.fine(counterDT.toString()); + if (log.isLoggable(Level.FINE)) log.fine(counterDT.toString()); if (!counterDT.isCreateCounter() || !counterDT.isValid()) return null; C_DocTypeTarget_ID = counterDT.getCounter_C_DocType_ID(); @@ -572,7 +572,7 @@ public class MRMA extends X_M_RMA implements DocAction else // indirect { C_DocTypeTarget_ID = MDocTypeCounter.getCounterDocType_ID(getCtx(), getC_DocType_ID()); - log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); + if (log.isLoggable(Level.FINE)) log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID); if (C_DocTypeTarget_ID <= 0) return null; } @@ -595,7 +595,7 @@ public class MRMA extends X_M_RMA implements DocAction counterLine.saveEx(get_TrxName()); } - log.fine(counter.toString()); + if (log.isLoggable(Level.FINE)) log.fine(counter.toString()); // Document Action if (counterDT != null) @@ -880,7 +880,7 @@ public class MRMA extends X_M_RMA implements DocAction new Object[]{processed, get_ID()}, get_TrxName()); m_lines = null; - log.fine("setProcessed - " + processed + " - Lines=" + noLine); + if (log.isLoggable(Level.FINE)) log.fine("setProcessed - " + processed + " - Lines=" + noLine); } // setProcessed /** diff --git a/org.adempiere.base/src/org/compiere/model/MRMALine.java b/org.adempiere.base/src/org/compiere/model/MRMALine.java index 44f899630c..f51afe8926 100644 --- a/org.adempiere.base/src/org/compiere/model/MRMALine.java +++ b/org.adempiere.base/src/org/compiere/model/MRMALine.java @@ -19,6 +19,7 @@ package org.compiere.model; import java.math.BigDecimal; import java.sql.ResultSet; import java.util.Properties; +import java.util.logging.Level; import org.compiere.util.DB; import org.compiere.util.Env; @@ -272,15 +273,17 @@ public class MRMALine extends X_M_RMALine if (stdTax != null) { - log.fine("stdTax rate is " + stdTax.getRate()); - log.fine("orderTax rate is " + orderTax.getRate()); + if (log.isLoggable(Level.FINE)){ + log.fine("stdTax rate is " + stdTax.getRate()); + log.fine("orderTax rate is " + orderTax.getRate()); + } taxThisAmt = taxThisAmt.add(orderTax.calculateTax(bd, getParent().isTaxIncluded(), getPrecision())); taxStdAmt = taxStdAmt.add(stdTax.calculateTax(bd, getParent().isTaxIncluded(), getPrecision())); bd = bd.subtract(taxStdAmt).add(taxThisAmt); - log.fine("Price List includes Tax and Tax Changed on Order Line: New Tax Amt: " + if (log.isLoggable(Level.FINE)) log.fine("Price List includes Tax and Tax Changed on Order Line: New Tax Amt: " + taxThisAmt + " Standard Tax Amt: " + taxStdAmt + " Line Net Amt: " + bd); } diff --git a/org.adempiere.base/src/org/compiere/model/MRMATax.java b/org.adempiere.base/src/org/compiere/model/MRMATax.java index fd7e4256fa..bd80356233 100644 --- a/org.adempiere.base/src/org/compiere/model/MRMATax.java +++ b/org.adempiere.base/src/org/compiere/model/MRMATax.java @@ -240,7 +240,7 @@ public class MRMATax extends X_M_RMATax setTaxBaseAmt (taxBaseAmt.subtract(taxAmt)); else setTaxBaseAmt (taxBaseAmt); - log.fine(toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString()); return true; } // calculateTaxFromLines diff --git a/org.adempiere.base/src/org/compiere/model/MRegistration.java b/org.adempiere.base/src/org/compiere/model/MRegistration.java index 2b8f7b116e..b3dfe6e5d3 100644 --- a/org.adempiere.base/src/org/compiere/model/MRegistration.java +++ b/org.adempiere.base/src/org/compiere/model/MRegistration.java @@ -213,7 +213,7 @@ public class MRegistration extends X_A_Registration if (regValue.save()) count++; } - log.fine("loadAttributeValues - #" + count + " (of " + attributes.length + ")"); + if (log.isLoggable(Level.FINE)) log.fine("loadAttributeValues - #" + count + " (of " + attributes.length + ")"); return count; } // loadAttrubuteValues @@ -244,7 +244,7 @@ public class MRegistration extends X_A_Registration if (regValue.save()) count++; } - log.fine("updateAttributeValues - #" + count + " (of " + regValues.length + ")"); + if (log.isLoggable(Level.FINE)) log.fine("updateAttributeValues - #" + count + " (of " + regValues.length + ")"); return count; } // updateAttrubuteValues diff --git a/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java b/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java index 368fc65b8e..a2b6c9ab73 100644 --- a/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java +++ b/org.adempiere.base/src/org/compiere/model/MRequisitionLine.java @@ -231,7 +231,7 @@ public class MRequisitionLine extends X_M_RequisitionLine if (getM_Product_ID() == 0) return; // - log.fine("M_PriceList_ID=" + M_PriceList_ID); + if (log.isLoggable(Level.FINE)) log.fine("M_PriceList_ID=" + M_PriceList_ID); boolean isSOTrx = false; MProductPricing pp = new MProductPricing (getM_Product_ID(), getC_BPartner_ID(), getQty(), isSOTrx); diff --git a/org.adempiere.base/src/org/compiere/model/MRole.java b/org.adempiere.base/src/org/compiere/model/MRole.java index 8f119c8839..88ec4bb31a 100644 --- a/org.adempiere.base/src/org/compiere/model/MRole.java +++ b/org.adempiere.base/src/org/compiere/model/MRole.java @@ -546,7 +546,7 @@ public final class MRole extends X_AD_Role int docactDel = DB.executeUpdate("DELETE FROM AD_Document_Action_Access" + whereDel, get_TrxName()); - log.fine("AD_Window_Access=" + winDel + if (log.isLoggable(Level.FINE)) log.fine("AD_Window_Access=" + winDel + ", AD_Process_Access=" + procDel + ", AD_Form_Access=" + formDel + ", AD_Workflow_Access=" + wfDel @@ -702,7 +702,7 @@ public final class MRole extends X_AD_Role m_orgAccess = new OrgAccess[list.size()]; list.toArray(m_orgAccess); - log.fine("#" + m_orgAccess.length + (reload ? " - reload" : "")); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_orgAccess.length + (reload ? " - reload" : "")); if (Ini.isClient()) { StringBuilder sb = new StringBuilder(); @@ -859,7 +859,7 @@ public final class MRole extends X_AD_Role } m_tableAccess = new MTableAccess[list.size()]; list.toArray(m_tableAccess); - log.fine("#" + m_tableAccess.length); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_tableAccess.length); } // loadTableAccess /** @@ -909,7 +909,7 @@ public final class MRole extends X_AD_Role { DB.close(rs, pstmt); } - log.fine("#" + m_tableAccessLevel.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_tableAccessLevel.size()); } // loadTableAccessLevel /** @@ -960,7 +960,7 @@ public final class MRole extends X_AD_Role } m_columnAccess = new MColumnAccess[list.size()]; list.toArray(m_columnAccess); - log.fine("#" + m_columnAccess.length); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_columnAccess.length); } // loadColumnAccess /** @@ -1002,7 +1002,7 @@ public final class MRole extends X_AD_Role list.toArray(m_recordAccess); m_recordDependentAccess = new MRecordAccess[dependent.size()]; dependent.toArray(m_recordDependentAccess); - log.fine("#" + m_recordAccess.length + " - Dependent #" + m_recordDependentAccess.length); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_recordAccess.length + " - Dependent #" + m_recordDependentAccess.length); } // loadRecordAccess @@ -1191,7 +1191,7 @@ public final class MRole extends X_AD_Role if (m_tableAccess[i].getAD_Table_ID() == AD_Table_ID) { canReport = m_tableAccess[i].isCanReport(); - log.fine("Exclude " + AD_Table_ID + " - " + canReport); + if (log.isLoggable(Level.FINE)) log.fine("Exclude " + AD_Table_ID + " - " + canReport); return canReport; } } @@ -1201,12 +1201,12 @@ public final class MRole extends X_AD_Role if (m_tableAccess[i].getAD_Table_ID() == AD_Table_ID) { canReport = m_tableAccess[i].isCanReport(); - log.fine("Include " + AD_Table_ID + " - " + canReport); + if (log.isLoggable(Level.FINE)) log.fine("Include " + AD_Table_ID + " - " + canReport); return canReport; } } } // for all Table Access - log.fine(AD_Table_ID + " - " + canReport); + if (log.isLoggable(Level.FINE)) log.fine(AD_Table_ID + " - " + canReport); return canReport; } // isCanReport @@ -1235,18 +1235,18 @@ public final class MRole extends X_AD_Role if (m_tableAccess[i].isExclude()) // Exclude { canExport = m_tableAccess[i].isCanExport(); - log.fine("Exclude " + AD_Table_ID + " - " + canExport); + if (log.isLoggable(Level.FINE)) log.fine("Exclude " + AD_Table_ID + " - " + canExport); return canExport; } else // Include { canExport = false; canExport = m_tableAccess[i].isCanExport(); - log.fine("Include " + AD_Table_ID + " - " + canExport); + if (log.isLoggable(Level.FINE)) log.fine("Include " + AD_Table_ID + " - " + canExport); return canExport; } } // for all Table Access - log.fine(AD_Table_ID + " - " + canExport); + if (log.isLoggable(Level.FINE)) log.fine(AD_Table_ID + " - " + canExport); return canExport; } // isCanExport @@ -1277,7 +1277,7 @@ public final class MRole extends X_AD_Role hasAccess = m_tableAccess[i].isReadOnly(); else hasAccess = false; - log.fine("Exclude AD_Table_ID=" + AD_Table_ID + if (log.isLoggable(Level.FINE)) log.fine("Exclude AD_Table_ID=" + AD_Table_ID + " (ro=" + ro + ",TableAccessRO=" + m_tableAccess[i].isReadOnly() + ") = " + hasAccess); return hasAccess; } @@ -1293,14 +1293,14 @@ public final class MRole extends X_AD_Role hasAccess = !m_tableAccess[i].isReadOnly(); else hasAccess = true; - log.fine("Include AD_Table_ID=" + AD_Table_ID + if (log.isLoggable(Level.FINE)) log.fine("Include AD_Table_ID=" + AD_Table_ID + " (ro=" + ro + ",TableAccessRO=" + m_tableAccess[i].isReadOnly() + ") = " + hasAccess); return hasAccess; } } } // for all Table Access if (!hasAccess) - log.fine("AD_Table_ID=" + AD_Table_ID + if (log.isLoggable(Level.FINE)) log.fine("AD_Table_ID=" + AD_Table_ID + "(ro=" + ro + ") = " + hasAccess); return hasAccess; } // isTableAccess @@ -1323,7 +1323,7 @@ public final class MRole extends X_AD_Role String roleAccessLevel = (String)m_tableAccessLevel.get(new Integer(AD_Table_ID)); if (roleAccessLevel == null) { - log.fine("NO - No AccessLevel - AD_Table_ID=" + AD_Table_ID); + if (log.isLoggable(Level.FINE)) log.fine("NO - No AccessLevel - AD_Table_ID=" + AD_Table_ID); return false; } // Access to all User Levels @@ -1344,7 +1344,7 @@ public final class MRole extends X_AD_Role && (roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_Organization) || roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_ClientPlusOrganization))) return true; - log.fine("NO - AD_Table_ID=" + AD_Table_ID + if (log.isLoggable(Level.FINE)) log.fine("NO - AD_Table_ID=" + AD_Table_ID + ", UserLevel=" + userLevel + ", AccessLevel=" + roleAccessLevel); return false; } // isTableAccessLevel @@ -1378,7 +1378,7 @@ public final class MRole extends X_AD_Role else retValue = false; if (!retValue) - log.fine("Exclude AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID + if (log.isLoggable(Level.FINE)) log.fine("Exclude AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID + " (ro=" + ro + ",ColumnAccessRO=" + m_columnAccess[i].isReadOnly() + ") = " + retValue); return retValue; } @@ -1397,7 +1397,7 @@ public final class MRole extends X_AD_Role else retValue = true; if (!retValue) - log.fine("Include AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID + if (log.isLoggable(Level.FINE)) log.fine("Include AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID + " (ro=" + ro + ",ColumnAccessRO=" + m_columnAccess[i].isReadOnly() + ") = " + retValue); return retValue; } @@ -1405,7 +1405,7 @@ public final class MRole extends X_AD_Role } // include } // for all Table Access if (!retValue) - log.fine("AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID + if (log.isLoggable(Level.FINE)) log.fine("AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID + " (ro=" + ro + ") = " + retValue); return retValue; } // isColumnAccess @@ -1538,10 +1538,10 @@ public final class MRole extends X_AD_Role } // setAccessMap("m_windowAccess", mergeAccess(getAccessMap("m_windowAccess"), directAccess, true)); - log.fine("#" + m_windowAccess.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_windowAccess.size()); } // reload Boolean retValue = m_windowAccess.get(AD_Window_ID); - log.fine("getWindowAccess - AD_Window_ID=" + AD_Window_ID + " - " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("getWindowAccess - AD_Window_ID=" + AD_Window_ID + " - " + retValue); return retValue; } // getWindowAccess @@ -1955,7 +1955,7 @@ public final class MRole extends X_AD_Role if (AD_Table_ID != 0 && !isTableAccess(AD_Table_ID, !rw)) { retSQL.append(" AND 1=3"); // prevent access at all - log.fine("No access to AD_Table_ID=" + AD_Table_ID + if (log.isLoggable(Level.FINE)) log.fine("No access to AD_Table_ID=" + AD_Table_ID + " - " + TableName + " - " + retSQL); break; // no need to check further } @@ -2030,12 +2030,12 @@ public final class MRole extends X_AD_Role if (m_recordDependentAccess[i].isExclude()) { excludes.add(m_recordDependentAccess[i].getRecord_ID()); - log.fine("Exclude " + columnName + " - " + m_recordDependentAccess[i]); + if (log.isLoggable(Level.FINE)) log.fine("Exclude " + columnName + " - " + m_recordDependentAccess[i]); } else if (!rw || !m_recordDependentAccess[i].isReadOnly()) { includes.add(m_recordDependentAccess[i].getRecord_ID()); - log.fine("Include " + columnName + " - " + m_recordDependentAccess[i]); + if (log.isLoggable(Level.FINE)) log.fine("Include " + columnName + " - " + m_recordDependentAccess[i]); } whereColumnName = getDependentRecordWhereColumn (mainSql, columnName); } // for all dependent records diff --git a/org.adempiere.base/src/org/compiere/model/MSchedule.java b/org.adempiere.base/src/org/compiere/model/MSchedule.java index c4b8ceab3a..4c84c6f65f 100644 --- a/org.adempiere.base/src/org/compiere/model/MSchedule.java +++ b/org.adempiere.base/src/org/compiere/model/MSchedule.java @@ -178,7 +178,7 @@ public class MSchedule extends X_AD_Schedule } } catch (PatternSyntaxException e) { // TODO: handle exception - log.fine("Error: " + e.getLocalizedMessage()); + if (log.isLoggable(Level.FINE)) log.fine("Error: " + e.getLocalizedMessage()); } return IsIp; } diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index 631314e1e1..7d87ad4c88 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -961,7 +961,7 @@ public class MSequence extends X_AD_Sequence changeMsg += " - " +getName() + " Sys " + currentNextSysValue + " -> " + maxTableSysID; } if (info != null) - log.fine(getName() + " - " + info); + if (log.isLoggable(Level.FINE)) log.fine(getName() + " - " + info); return changeMsg; } // validate diff --git a/org.adempiere.base/src/org/compiere/model/MSetup.java b/org.adempiere.base/src/org/compiere/model/MSetup.java index ee274e77e7..0985010a50 100644 --- a/org.adempiere.base/src/org/compiere/model/MSetup.java +++ b/org.adempiere.base/src/org/compiere/model/MSetup.java @@ -449,7 +449,7 @@ public final class MSetup } int C_ElementValue_ID = m_nap.getC_ElementValue_ID("DEFAULT_ACCT"); - log.fine("C_ElementValue_ID=" + C_ElementValue_ID); + if (log.isLoggable(Level.FINE)) log.fine("C_ElementValue_ID=" + C_ElementValue_ID); /** * Create AccountingSchema diff --git a/org.adempiere.base/src/org/compiere/model/MSysConfig.java b/org.adempiere.base/src/org/compiere/model/MSysConfig.java index 4c5dbc8d6e..d7037c1ae8 100644 --- a/org.adempiere.base/src/org/compiere/model/MSysConfig.java +++ b/org.adempiere.base/src/org/compiere/model/MSysConfig.java @@ -558,7 +558,7 @@ public class MSysConfig extends X_AD_SysConfig */ protected boolean beforeSave (boolean newRecord) { - log.fine("New=" + newRecord); + if (log.isLoggable(Level.FINE)) log.fine("New=" + newRecord); if (getAD_Client_ID() != 0 || getAD_Org_ID() != 0) { diff --git a/org.adempiere.base/src/org/compiere/model/MTax.java b/org.adempiere.base/src/org/compiere/model/MTax.java index 113b7f2974..f3209da83d 100644 --- a/org.adempiere.base/src/org/compiere/model/MTax.java +++ b/org.adempiere.base/src/org/compiere/model/MTax.java @@ -20,6 +20,7 @@ import java.math.BigDecimal; 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.Env; @@ -271,7 +272,7 @@ public class MTax extends X_C_Tax tax = amount.subtract(base); } BigDecimal finalTax = tax.setScale(scale, BigDecimal.ROUND_HALF_UP); - log.fine("calculateTax " + amount + if (log.isLoggable(Level.FINE)) log.fine("calculateTax " + amount + " (incl=" + taxIncluded + ",mult=" + multiplier + ",scale=" + scale + ") = " + finalTax + " [" + tax + "]"); return finalTax; diff --git a/org.adempiere.base/src/org/compiere/model/MTemplate.java b/org.adempiere.base/src/org/compiere/model/MTemplate.java index 119f820b26..f4fff8adba 100644 --- a/org.adempiere.base/src/org/compiere/model/MTemplate.java +++ b/org.adempiere.base/src/org/compiere/model/MTemplate.java @@ -222,7 +222,7 @@ public class MTemplate extends X_CM_Template ", 0, 999)"); int no = DB.executeUpdate (sb.toString (), get_TrxName ()); if (no > 0) - log.fine ("#" + no + " - TreeType=CMT"); + if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMT"); else log.warning ("#" + no + " - TreeType=CMT"); return no > 0; @@ -263,7 +263,7 @@ public class MTemplate extends X_CM_Template " AND AD_Tree_ID=").append (getAD_Tree_ID ()); int no = DB.executeUpdate (sb.toString (), get_TrxName ()); if (no > 0) - log.fine ("#" + no + " - TreeType=CMT"); + if (log.isLoggable(Level.FINE)) log.fine ("#" + no + " - TreeType=CMT"); else log.warning ("#" + no + " - TreeType=CMT"); return no > 0; diff --git a/org.adempiere.base/src/org/compiere/model/MTimeExpense.java b/org.adempiere.base/src/org/compiere/model/MTimeExpense.java index 4b46441cd1..1f65f0efb7 100644 --- a/org.adempiere.base/src/org/compiere/model/MTimeExpense.java +++ b/org.adempiere.base/src/org/compiere/model/MTimeExpense.java @@ -209,7 +209,7 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction + "' WHERE S_TimeExpense_ID=" + getS_TimeExpense_ID(); int noLine = DB.executeUpdate(sql, get_TrxName()); m_lines = null; - log.fine(processed + " - Lines=" + noLine); + if (log.isLoggable(Level.FINE)) log.fine(processed + " - Lines=" + noLine); } // setProcessed /** diff --git a/org.adempiere.base/src/org/compiere/model/MTree.java b/org.adempiere.base/src/org/compiere/model/MTree.java index a8aba685e1..bd59d3bfeb 100644 --- a/org.adempiere.base/src/org/compiere/model/MTree.java +++ b/org.adempiere.base/src/org/compiere/model/MTree.java @@ -320,7 +320,7 @@ public class MTree extends MTree_Base trimTree(); // diagPrintTree(); if (CLogMgt.isLevelFinest() || m_root.getChildCount() == 0) - log.fine("ChildCount=" + m_root.getChildCount()); + if (log.isLoggable(Level.FINE)) log.fine("ChildCount=" + m_root.getChildCount()); } // loadNodes /** diff --git a/org.adempiere.base/src/org/compiere/model/M_Element.java b/org.adempiere.base/src/org/compiere/model/M_Element.java index 784f2c8bde..d60d53671d 100644 --- a/org.adempiere.base/src/org/compiere/model/M_Element.java +++ b/org.adempiere.base/src/org/compiere/model/M_Element.java @@ -18,6 +18,7 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; +import java.util.logging.Level; import org.compiere.util.DB; import org.compiere.util.Env; @@ -226,7 +227,7 @@ public class M_Element extends X_AD_Element .append(", Help=").append(DB.TO_STRING(getHelp())) .append(" WHERE AD_Element_ID=").append(get_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("afterSave - Columns updated #" + no); + if (log.isLoggable(Level.FINE)) log.fine("afterSave - Columns updated #" + no); // Parameter sql = new StringBuilder("UPDATE AD_Process_Para SET ColumnName=") @@ -248,7 +249,7 @@ public class M_Element extends X_AD_Element .append(" WHERE AD_Element_ID=").append(get_ID()) .append(" AND IsCentrallyMaintained='Y'"); no += DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Parameters updated #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Parameters updated #" + no); // Info Column sql = new StringBuilder("UPDATE AD_InfoColumn SET ColumnName=") @@ -259,7 +260,7 @@ public class M_Element extends X_AD_Element .append(" WHERE AD_Element_ID=").append(get_ID()) .append(" AND IsCentrallyMaintained='Y'"); no += DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Info Column updated #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Info Column updated #" + no); } if ( is_ValueChanged(M_Element.COLUMNNAME_Name) @@ -275,7 +276,7 @@ public class M_Element extends X_AD_Element .append(get_ID()) .append(") AND IsCentrallyMaintained='Y'"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Fields updated #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Fields updated #" + no); // Info Column - update Name, Description, Help - doesn't have IsCentrallyMaintained currently // no = DB.executeUpdate(sql.toString(), get_TrxName()); @@ -294,7 +295,7 @@ public class M_Element extends X_AD_Element .append("WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=") .append(get_ID()).append(")"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("PrintFormatItem updated #" + no); + if (log.isLoggable(Level.FINE)) log.fine("PrintFormatItem updated #" + no); } } diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index 363a9c3744..6c474e2efb 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -1958,7 +1958,7 @@ public abstract class PO boolean newRecord = is_new(); // save locally as load resets if (!newRecord && !is_Changed()) { - log.fine("Nothing changed - " + p_info.getTableName()); + if (log.isLoggable(Level.FINE)) log.fine("Nothing changed - " + p_info.getTableName()); return true; } @@ -2566,9 +2566,9 @@ public abstract class PO if (changes) { if (m_trxName == null) - log.fine(p_info.getTableName() + "." + where); + if (log.isLoggable(Level.FINE)) log.fine(p_info.getTableName() + "." + where); else - log.fine("[" + m_trxName + "] - " + p_info.getTableName() + "." + where); + if (log.isLoggable(Level.FINE)) log.fine("[" + m_trxName + "] - " + p_info.getTableName() + "." + where); if (!updated) // Updated not explicitly set { Timestamp now = new Timestamp(System.currentTimeMillis()); @@ -2675,9 +2675,9 @@ public abstract class PO } } if (m_trxName == null) - log.fine(p_info.getTableName() + " - " + get_WhereClause(true)); + if (log.isLoggable(Level.FINE)) log.fine(p_info.getTableName() + " - " + get_WhereClause(true)); else - log.fine("[" + m_trxName + "] - " + p_info.getTableName() + " - " + get_WhereClause(true)); + if (log.isLoggable(Level.FINE)) log.fine("[" + m_trxName + "] - " + p_info.getTableName() + " - " + get_WhereClause(true)); // Set new DocumentNo String columnName = "DocumentNo"; @@ -3193,7 +3193,7 @@ public abstract class PO if (m_trxName == null) log.fine("complete"); else - log.fine("[" + m_trxName + "] - complete"); + if (log.isLoggable(Level.FINE)) log.fine("[" + m_trxName + "] - complete"); m_attachment = null; } } @@ -3400,7 +3400,7 @@ public abstract class PO MColumn column = new MColumn(getCtx(), uuidColumnId, get_TrxName()); UUIDGenerator.updateUUID(column, get_TrxName()); } - log.fine("#" + no); + if (log.isLoggable(Level.FINE)) log.fine("#" + no); return no > 0; } // insertTranslations @@ -3467,7 +3467,7 @@ public abstract class PO sql.append(" WHERE ") .append(keyColumn).append("=").append(get_ID()); int no = DB.executeUpdate(sql.toString(), m_trxName); - log.fine("#" + no); + if (log.isLoggable(Level.FINE)) log.fine("#" + no); return no >= 0; } // updateTranslations @@ -3491,7 +3491,7 @@ public abstract class PO .append(tableName).append("_Trl WHERE ") .append(keyColumn).append("=").append(get_ID()); int no = DB.executeUpdate(sql.toString(), trxName); - log.fine("#" + no); + if (log.isLoggable(Level.FINE)) log.fine("#" + no); return no >= 0; } // deleteTranslations @@ -3573,7 +3573,7 @@ public abstract class PO // int no = DB.executeUpdate(sb.toString(), get_TrxName()); if (no > 0) - log.fine("#" + no); + if (log.isLoggable(Level.FINE)) log.fine("#" + no); else log.warning("#" + no + " - Table=" + acctTable + " from " + acctBaseTable); @@ -3652,7 +3652,7 @@ public abstract class PO + "WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=").append(get_ID()).append(")"); int no = DB.executeUpdate(sb.toString(), get_TrxName()); if (no > 0) - log.fine("#" + no + " - TreeType=" + treeType); + if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=" + treeType); else log.warning("#" + no + " - TreeType=" + treeType); @@ -3682,7 +3682,7 @@ public abstract class PO .append(treeType).append("')"); int no = DB.executeUpdate(sb.toString(), get_TrxName()); if (no > 0) - log.fine("#" + no + " - TreeType=" + treeType); + if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - TreeType=" + treeType); else log.warning("#" + no + " - TreeType=" + treeType); return no > 0; @@ -3744,7 +3744,7 @@ public abstract class PO else success = DB.executeUpdate(sql, trxName) == 1; if (success) - log.fine("success" + (trxName == null ? "" : "[" + trxName + "]")); + if (log.isLoggable(Level.FINE)) log.fine("success" + (trxName == null ? "" : "[" + trxName + "]")); else log.log(Level.WARNING, "failed" + (trxName == null ? "" : " [" + trxName + "]")); return success; @@ -3824,7 +3824,7 @@ public abstract class PO { if (m_attachment.getEntryName(i).endsWith(extension)) { - log.fine("#" + i + ": " + m_attachment.getEntryName(i)); + if (log.isLoggable(Level.FINE)) log.fine("#" + i + ": " + m_attachment.getEntryName(i)); return true; } } @@ -3845,7 +3845,7 @@ public abstract class PO { if (m_attachment.getEntryName(i).endsWith(extension)) { - log.fine("#" + i + ": " + m_attachment.getEntryName(i)); + if (log.isLoggable(Level.FINE)) log.fine("#" + i + ": " + m_attachment.getEntryName(i)); return m_attachment.getEntryData(i); } } @@ -3977,7 +3977,7 @@ public abstract class PO */ private Object get_LOB (Object value) { - log.fine("Value=" + value); + if (log.isLoggable(Level.FINE)) log.fine("Value=" + value); if (value == null) return null; // diff --git a/org.adempiere.base/src/org/compiere/model/PO_LOB.java b/org.adempiere.base/src/org/compiere/model/PO_LOB.java index ca7bfccabb..fec006f834 100644 --- a/org.adempiere.base/src/org/compiere/model/PO_LOB.java +++ b/org.adempiere.base/src/org/compiere/model/PO_LOB.java @@ -105,7 +105,7 @@ public class PO_LOB implements Serializable .append(" SET ").append(m_columnName) .append("=null WHERE ").append(m_whereClause); int no = DB.executeUpdate(sql.toString(), trxName); - log.fine("save [" + trxName + "] #" + no + " - no data - set to null - " + m_value); + if (log.isLoggable(Level.FINE)) log.fine("save [" + trxName + "] #" + no + " - no data - set to null - " + m_value); if (no == 0) log.warning("[" + trxName + "] - not updated - " + sql); return true; @@ -117,7 +117,7 @@ public class PO_LOB implements Serializable .append("=? WHERE ").append(m_whereClause); // - log.fine("[" + trxName + "] - Local - " + m_value); + if (log.isLoggable(Level.FINE)) log.fine("[" + trxName + "] - Local - " + m_value); // Connection Trx trx = null; if (trxName != null) diff --git a/org.adempiere.base/src/org/compiere/model/PaymentProcessor.java b/org.adempiere.base/src/org/compiere/model/PaymentProcessor.java index 9a604081bc..dd9886ccd2 100644 --- a/org.adempiere.base/src/org/compiere/model/PaymentProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/PaymentProcessor.java @@ -298,7 +298,7 @@ public abstract class PaymentProcessor log.log(Level.SEVERE, result, e); } long ms = System.currentTimeMillis() - start; - log.fine(ms + "ms - " + prop.toString()); + if (log.isLoggable(Level.FINE)) log.fine(ms + "ms - " + prop.toString()); return prop; } // connectPost @@ -319,7 +319,7 @@ public abstract class PaymentProcessor connection.setDoOutput(true); connection.setUseCaches(false); connection.setRequestProperty("Content-Type","application/x-www-form-urlencoded"); - log.fine(connection.getURL().toString()); + if (log.isLoggable(Level.FINE)) log.fine(connection.getURL().toString()); // POST the parameter DataOutputStream out = new DataOutputStream (connection.getOutputStream()); diff --git a/org.adempiere.base/src/org/compiere/model/ScheduleUtil.java b/org.adempiere.base/src/org/compiere/model/ScheduleUtil.java index 5f5ecbfb86..a1a542bafd 100644 --- a/org.adempiere.base/src/org/compiere/model/ScheduleUtil.java +++ b/org.adempiere.base/src/org/compiere/model/ScheduleUtil.java @@ -122,7 +122,7 @@ public class ScheduleUtil m_endDate = end_Date; if (m_endDate == null) m_endDate = MUOMConversion.getEndDate(m_ctx, m_startDate, m_C_UOM_ID, qty); - log.fine( "- EndDate=" + m_endDate); + if (log.isLoggable(Level.FINE)) log.fine( "- EndDate=" + m_endDate); // Resource Unavailability ------------------------------------------- diff --git a/org.adempiere.base/src/org/compiere/model/Tax.java b/org.adempiere.base/src/org/compiere/model/Tax.java index f723a593b9..1a9f67e1c5 100644 --- a/org.adempiere.base/src/org/compiere/model/Tax.java +++ b/org.adempiere.base/src/org/compiere/model/Tax.java @@ -206,7 +206,7 @@ public class Tax shipToC_Location_ID = temp; } // - log.fine("getCharge - C_TaxCategory_ID=" + C_TaxCategory_ID + if (log.isLoggable(Level.FINE)) log.fine("getCharge - C_TaxCategory_ID=" + C_TaxCategory_ID + ", billFromC_Location_ID=" + billFromC_Location_ID + ", billToC_Location_ID=" + billToC_Location_ID + ", shipFromC_Location_ID=" + shipFromC_Location_ID @@ -297,7 +297,7 @@ public class Tax // if (found && "Y".equals(IsTaxExempt)) { - log.fine("getProduct - Business Partner is Tax exempt"); + if (log.isLoggable(Level.FINE)) log.fine("getProduct - Business Partner is Tax exempt"); return getExemptTax(ctx, AD_Org_ID); } else if (found) @@ -311,7 +311,7 @@ public class Tax shipFromC_Location_ID = shipToC_Location_ID; shipToC_Location_ID = temp; } - log.fine("getProduct - C_TaxCategory_ID=" + C_TaxCategory_ID + if (log.isLoggable(Level.FINE)) log.fine("getProduct - C_TaxCategory_ID=" + C_TaxCategory_ID + ", billFromC_Location_ID=" + billFromC_Location_ID + ", billToC_Location_ID=" + billToC_Location_ID + ", shipFromC_Location_ID=" + shipFromC_Location_ID @@ -334,7 +334,7 @@ public class Tax { throw new TaxCriteriaNotFoundException(variable, M_Product_ID); } - log.fine("getProduct - C_TaxCategory_ID=" + C_TaxCategory_ID); + if (log.isLoggable(Level.FINE)) log.fine("getProduct - C_TaxCategory_ID=" + C_TaxCategory_ID); // AD_Org_ID -> billFromC_Location_ID variable = "AD_Org_ID"; @@ -379,9 +379,11 @@ public class Tax billFromC_Location_ID = billToC_Location_ID; billToC_Location_ID = temp; } - log.fine("getProduct - billFromC_Location_ID = " + billFromC_Location_ID); - log.fine("getProduct - billToC_Location_ID = " + billToC_Location_ID); - + if (log.isLoggable(Level.FINE)){ + log.fine("getProduct - billFromC_Location_ID = " + billFromC_Location_ID); + log.fine("getProduct - billToC_Location_ID = " + billToC_Location_ID); + } + //----------------------------------------------------------------- // M_Warehouse_ID -> shipFromC_Location_ID @@ -411,8 +413,8 @@ public class Tax shipFromC_Location_ID = shipToC_Location_ID; shipToC_Location_ID = temp; } - log.fine("getProduct - shipFromC_Location_ID = " + shipFromC_Location_ID); - log.fine("getProduct - shipToC_Location_ID = " + shipToC_Location_ID); + if (log.isLoggable(Level.FINE)) log.fine("getProduct - shipFromC_Location_ID = " + shipFromC_Location_ID); + if (log.isLoggable(Level.FINE)) log.fine("getProduct - shipToC_Location_ID = " + shipToC_Location_ID); } catch (SQLException e) { @@ -444,7 +446,7 @@ public class Tax + "WHERE t.IsTaxExempt='Y' AND o.AD_Org_ID=? " + "ORDER BY t.Rate DESC"; int C_Tax_ID = DB.getSQLValueEx(null, sql, AD_Org_ID); - log.fine("getExemptTax - TaxExempt=Y - C_Tax_ID=" + C_Tax_ID); + if (log.isLoggable(Level.FINE)) log.fine("getExemptTax - TaxExempt=Y - C_Tax_ID=" + C_Tax_ID); if (C_Tax_ID <= 0) { throw new TaxNoExemptFoundException(AD_Org_ID); @@ -565,7 +567,7 @@ public class Tax continue; if (!IsSOTrx && MTax.SOPOTYPE_SalesTax.equals(tax.getSOPOType())) continue; - log.fine("get (default) - " + tax); + if (log.isLoggable(Level.FINE)) log.fine("get (default) - " + tax); return tax.getC_Tax_ID(); } // for all taxes diff --git a/org.adempiere.base/src/org/compiere/model/TranslationTable.java b/org.adempiere.base/src/org/compiere/model/TranslationTable.java index 17ecde661c..0336644ca6 100644 --- a/org.adempiere.base/src/org/compiere/model/TranslationTable.java +++ b/org.adempiere.base/src/org/compiere/model/TranslationTable.java @@ -17,6 +17,7 @@ package org.compiere.model; import java.util.ArrayList; +import java.util.logging.Level; import org.compiere.util.CCache; import org.compiere.util.CLogger; @@ -119,7 +120,7 @@ public class TranslationTable m_baseTableName = baseTableName; m_trlTableName = baseTableName + "_Trl"; initColumns(); - log.fine(toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString()); } // TranslationTable /** Static Logger */ @@ -200,7 +201,7 @@ public class TranslationTable + " b WHERE l.IsActive = 'Y' AND l.IsSystemLanguage = 'Y' AND b." + m_baseTableName + "_ID=").append(po.get_ID()); int no = DB.executeUpdate(sql.toString(), po.get_TrxName()); - log.fine(m_trlTableName + ": ID=" + po.get_ID() + " #" + no); + if (log.isLoggable(Level.FINE)) log.fine(m_trlTableName + ": ID=" + po.get_ID() + " #" + no); return no != 0; } // createTranslation @@ -221,7 +222,7 @@ public class TranslationTable .append(" SET IsTranslated='N',Updated=SysDate WHERE ") .append(m_baseTableName).append("_ID=").append(po.get_ID()); int no = DB.executeUpdate(sb.toString(), po.get_TrxName()); - log.fine(m_trlTableName + ": ID=" + po.get_ID() + " #" + no); + if (log.isLoggable(Level.FINE)) log.fine(m_trlTableName + ": ID=" + po.get_ID() + " #" + no); return no != 0; } // resetTranslationFlag @@ -242,7 +243,7 @@ public class TranslationTable .append(" WHERE ") .append(m_baseTableName).append("_ID=").append(po.get_IDOld()); int no = DB.executeUpdate(sb.toString(), po.get_TrxName()); - log.fine(m_trlTableName + ": ID=" + po.get_IDOld() + " #" + no); + if (log.isLoggable(Level.FINE)) log.fine(m_trlTableName + ": ID=" + po.get_IDOld() + " #" + no); return no != 0; } // resetTranslationFlag diff --git a/org.adempiere.base/src/org/compiere/print/CPaper.java b/org.adempiere.base/src/org/compiere/print/CPaper.java index ca70af8898..4204423b28 100644 --- a/org.adempiere.base/src/org/compiere/print/CPaper.java +++ b/org.adempiere.base/src/org/compiere/print/CPaper.java @@ -21,6 +21,7 @@ import java.awt.print.PageFormat; import java.awt.print.Paper; import java.awt.print.PrinterJob; import java.util.Properties; +import java.util.logging.Level; import javax.print.attribute.Attribute; import javax.print.attribute.HashPrintRequestAttributeSet; @@ -145,7 +146,7 @@ public class CPaper extends Paper double height = m_mediaSize.getY (MediaSize.INCH) * 72; // Set Size setSize (width, height); - log.fine(mediaSize.getMediaSizeName() + ": " + m_mediaSize + " - Landscape=" + m_landscape); + if (log.isLoggable(Level.FINE)) log.fine(mediaSize.getMediaSizeName() + ": " + m_mediaSize + " - Landscape=" + m_landscape); } // setMediaSize /** @@ -183,7 +184,7 @@ public class CPaper extends Paper final double height = y * mult; // Set Size setSize (width, height); - log.fine("Width & Height" + ": " + x + "/" + y + " - Landscape=" + m_landscape); + if (log.isLoggable(Level.FINE)) log.fine("Width & Height" + ": " + x + "/" + y + " - Landscape=" + m_landscape); } // setMediaSize //End Of AA Goodwill @@ -228,7 +229,7 @@ public class CPaper extends Paper public void setMediaPrintableArea (MediaPrintableArea area) { int inch = MediaPrintableArea.INCH; - log.fine(area.toString(inch, "\"")); + if (log.isLoggable(Level.FINE)) log.fine(area.toString(inch, "\"")); setImageableArea(area.getX(inch)*72, area.getY(inch)*72, area.getWidth(inch)*72, area.getHeight(inch)*72); } // setMediaPrintableArea diff --git a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java index 0b3fe5f4a0..b23a0413aa 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java @@ -350,7 +350,7 @@ public class MPrintFormat extends X_AD_PrintFormat + "WHERE AD_PrintFormatItem_ID IN" + " (SELECT AD_PrintFormatItem_ID FROM AD_PrintFormatItem WHERE AD_PrintFormat_ID=").append(get_ID()).append(")"); int no = DB.executeUpdate(sb.toString(), get_TrxName()); - log.fine("setTranslation #" + no); + if (log.isLoggable(Level.FINE)) log.fine("setTranslation #" + no); } // setTranslation diff --git a/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java b/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java index 9e92a8a873..5e4897bf0b 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java @@ -681,7 +681,7 @@ public class MPrintFormatItem extends X_AD_PrintFormatItem + " AND EXISTS (SELECT * FROM AD_Client " + "WHERE AD_Client_ID=trl.AD_Client_ID AND IsMultiLingualDocument='Y')"; int no = DB.executeUpdate(sql, get_TrxName()); - log.fine("translations updated #" + no); + if (log.isLoggable(Level.FINE)) log.fine("translations updated #" + no); } return success; diff --git a/org.adempiere.base/src/org/compiere/print/MPrintPaper.java b/org.adempiere.base/src/org/compiere/print/MPrintPaper.java index 152f76f2f0..ed153ab6e0 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintPaper.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintPaper.java @@ -162,7 +162,7 @@ public class MPrintPaper extends X_AD_PrintPaper if (nameMedia != null) { m_mediaSize = MediaSize.getMediaSizeForName(nameMedia); - log.fine("Name->Size=" + m_mediaSize); + if (log.isLoggable(Level.FINE)) log.fine("Name->Size=" + m_mediaSize); } } // Create New Media Size @@ -173,7 +173,7 @@ public class MPrintPaper extends X_AD_PrintPaper if (x > 0 && y > 0) { m_mediaSize = new MediaSize(x, y, getUnitsInt(), MediaSizeName.A); - log.fine("Size=" + m_mediaSize); + if (log.isLoggable(Level.FINE)) log.fine("Size=" + m_mediaSize); } } // Fallback @@ -191,7 +191,7 @@ public class MPrintPaper extends X_AD_PrintPaper m_mediaSize = Language.getLoginLanguage().getMediaSize(); if (m_mediaSize == null) m_mediaSize = MediaSize.ISO.A4; - log.fine("Size=" + m_mediaSize); + if (log.isLoggable(Level.FINE)) log.fine("Size=" + m_mediaSize); return m_mediaSize; } // getMediaSizeDefault diff --git a/org.adempiere.base/src/org/compiere/print/MPrintTableFormat.java b/org.adempiere.base/src/org/compiere/print/MPrintTableFormat.java index 22d781c165..dd3a0f345b 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintTableFormat.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintTableFormat.java @@ -640,7 +640,7 @@ public class MPrintTableFormat extends X_AD_PrintTableFormat } if (m_image != null) { - log.fine(attachment.getEntryName(0) + " - Size=" + imageData.length); + if (log.isLoggable(Level.FINE)) log.fine(attachment.getEntryName(0) + " - Size=" + imageData.length); } else { diff --git a/org.adempiere.base/src/org/compiere/print/PrintFormatUtil.java b/org.adempiere.base/src/org/compiere/print/PrintFormatUtil.java index f23d01a058..cf4d3996e4 100644 --- a/org.adempiere.base/src/org/compiere/print/PrintFormatUtil.java +++ b/org.adempiere.base/src/org/compiere/print/PrintFormatUtil.java @@ -124,7 +124,7 @@ public class PrintFormatUtil String ColumnName = rs.getString(2); MPrintFormatItem pfi = MPrintFormatItem.createFromColumn (pf, AD_Column_ID, 0); if (pfi.get_ID() != 0) - log.fine("#" + ++counter + " - added " + ColumnName); + if (log.isLoggable(Level.FINE)) log.fine("#" + ++counter + " - added " + ColumnName); else log.warning("Not added: " + ColumnName); } @@ -139,7 +139,7 @@ public class PrintFormatUtil rs = null; pstmt = null; } if (counter == 0) - log.fine("None" + if (log.isLoggable(Level.FINE)) log.fine("None" /** + " - " + sql + " - AD_PrintFormat_ID=" + pf.getAD_PrintFormat_ID() @@ -147,7 +147,7 @@ public class PrintFormatUtil */ ); else - log.fine("Added=" + counter); + if (log.isLoggable(Level.FINE)) log.fine("Added=" + counter); return counter; } // addMissingColumns diff --git a/org.adempiere.base/src/org/compiere/print/PrintUtil.java b/org.adempiere.base/src/org/compiere/print/PrintUtil.java index 4aee43fe42..b77616adc4 100644 --- a/org.adempiere.base/src/org/compiere/print/PrintUtil.java +++ b/org.adempiere.base/src/org/compiere/print/PrintUtil.java @@ -247,12 +247,12 @@ public class PrintUtil { Attribute[] atts = prats.toArray(); for (int i = 0; i < atts.length; i++) - log.fine(atts[i].getName() + "=" + atts[i]); + if (log.isLoggable(Level.FINE)) log.fine(atts[i].getName() + "=" + atts[i]); } // if (waitForIt) { - log.fine("(wait) " + job.getPrintService()); + if (log.isLoggable(Level.FINE)) log.fine("(wait) " + job.getPrintService()); try { job.print(prats); @@ -269,7 +269,7 @@ public class PrintUtil { public void run() { - log.fine("print: " + job.getPrintService()); + if (log.isLoggable(Level.FINE)) log.fine("print: " + job.getPrintService()); try { job.print(prats); diff --git a/org.adempiere.base/src/org/compiere/print/ReportEngine.java b/org.adempiere.base/src/org/compiere/print/ReportEngine.java index 2c518c97f6..20fcfbdcab 100644 --- a/org.adempiere.base/src/org/compiere/print/ReportEngine.java +++ b/org.adempiere.base/src/org/compiere/print/ReportEngine.java @@ -433,7 +433,7 @@ PrintServiceAttributeSet - length=1 queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) **/ if (log.isLoggable(Level.FINE)) - log.fine("attributeUpdate - " + psae); + if (log.isLoggable(Level.FINE)) log.fine("attributeUpdate - " + psae); // PrintUtil.dump (psae.getAttributes()); } // attributeUpdate @@ -981,7 +981,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) } if (log.isLoggable(Level.FINE)) - log.fine(uri.toString()); + if (log.isLoggable(Level.FINE)) log.fine(uri.toString()); try { @@ -1614,7 +1614,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) rs = null; pstmt = null; } if (log.isLoggable(Level.FINE)) - log.fine("Order => " + what[0] + " ID=" + what[1]); + if (log.isLoggable(Level.FINE)) log.fine("Order => " + what[0] + " ID=" + what[1]); return what; } // getDocumentWhat diff --git a/org.adempiere.base/src/org/compiere/print/layout/HTMLElement.java b/org.adempiere.base/src/org/compiere/print/layout/HTMLElement.java index 70bfbbaae5..fe53500e4b 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/HTMLElement.java +++ b/org.adempiere.base/src/org/compiere/print/layout/HTMLElement.java @@ -20,6 +20,7 @@ import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.geom.Point2D; import java.util.Properties; +import java.util.logging.Level; /** * HTML Form Print ELement. @@ -46,7 +47,7 @@ public class HTMLElement extends PrintElement { if (html == null || html.equals("")) throw new IllegalArgumentException("HTMLElement is null"); - log.fine("Length=" + html.length()); + if (log.isLoggable(Level.FINE)) log.fine("Length=" + html.length()); // Create View m_renderer = HTMLRenderer.get(html); } // HTMLElement diff --git a/org.adempiere.base/src/org/compiere/print/layout/ImageElement.java b/org.adempiere.base/src/org/compiere/print/layout/ImageElement.java index 6370a56d1c..71423ce0e6 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/ImageElement.java +++ b/org.adempiere.base/src/org/compiere/print/layout/ImageElement.java @@ -136,7 +136,7 @@ public class ImageElement extends PrintElement { m_image = image; if (m_image != null) - log.fine("Image=" + image); + if (log.isLoggable(Level.FINE)) log.fine("Image=" + image); else log.log(Level.WARNING, "Image is NULL"); } // ImageElement @@ -152,7 +152,7 @@ public class ImageElement extends PrintElement { m_image = Toolkit.getDefaultToolkit().createImage(imageURL); if (m_image != null) - log.fine("URL=" + imageURL); + if (log.isLoggable(Level.FINE)) log.fine("URL=" + imageURL); else log.log(Level.WARNING, "Not loaded - URL=" + imageURL); } @@ -170,7 +170,7 @@ public class ImageElement extends PrintElement { m_image = Toolkit.getDefaultToolkit().createImage(imageURL); if (m_image != null) - log.fine("URL=" + imageURL); + if (log.isLoggable(Level.FINE)) log.fine("URL=" + imageURL); else log.log(Level.WARNING, "Not loaded - URL=" + imageURL); } @@ -255,7 +255,7 @@ public class ImageElement extends PrintElement if (imageData != null) m_image = Toolkit.getDefaultToolkit().createImage(imageData); if (m_image != null) - log.fine(mimage.toString() + if (log.isLoggable(Level.FINE)) log.fine(mimage.toString() + " - Size=" + imageData.length); else log.log(Level.WARNING, mimage.toString() @@ -285,7 +285,7 @@ public class ImageElement extends PrintElement if (imageData != null) m_image = Toolkit.getDefaultToolkit().createImage(imageData); if (m_image != null) - log.fine(attachment.getEntryName(0) + if (log.isLoggable(Level.FINE)) log.fine(attachment.getEntryName(0) + " - Size=" + imageData.length); else log.log(Level.WARNING, attachment.getEntryName(0) diff --git a/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java b/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java index f7d60a7741..5dc27b19b0 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java +++ b/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java @@ -411,7 +411,7 @@ public class LayoutEngine implements Pageable, Printable, Doc if (log.isLoggable(Level.FINE)) { - log.fine("Paper=" + m_paper + ",HeaderHeight=" + m_headerHeight + ",FooterHeight=" + m_footerHeight + if (log.isLoggable(Level.FINE)) log.fine("Paper=" + m_paper + ",HeaderHeight=" + m_headerHeight + ",FooterHeight=" + m_footerHeight + " => Header=" + m_header + ",Contents=" + m_content + ",Footer=" + m_footer); } } // calculatePageSize diff --git a/org.adempiere.base/src/org/compiere/print/layout/PrintElement.java b/org.adempiere.base/src/org/compiere/print/layout/PrintElement.java index b232a6bea3..66e7660ac4 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/PrintElement.java +++ b/org.adempiere.base/src/org/compiere/print/layout/PrintElement.java @@ -327,7 +327,7 @@ public abstract class PrintElement implements ImageObserver, Serializable return false; } if (count > 0) - log.fine((System.currentTimeMillis()-start) + "ms - #" + count); + if (log.isLoggable(Level.FINE)) log.fine((System.currentTimeMillis()-start) + "ms - #" + count); return true; } // waitForLoad diff --git a/org.adempiere.base/src/org/compiere/print/layout/StringElement.java b/org.adempiere.base/src/org/compiere/print/layout/StringElement.java index f20be99995..6935799597 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/StringElement.java +++ b/org.adempiere.base/src/org/compiere/print/layout/StringElement.java @@ -375,7 +375,7 @@ public class StringElement extends PrintElement { if (m_ID != null && getBounds().contains(relativePoint)) { - log.fine(toString()); + if (log.isLoggable(Level.FINE)) log.fine(toString()); String columnName = MQuery.getZoomColumnName(m_ID.getName()); String tableName = MQuery.getZoomTableName(columnName); Object code = m_ID.getID(); diff --git a/org.adempiere.base/src/org/compiere/print/layout/TableElement.java b/org.adempiere.base/src/org/compiere/print/layout/TableElement.java index bce01aa29a..acb1d5a277 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/TableElement.java +++ b/org.adempiere.base/src/org/compiere/print/layout/TableElement.java @@ -175,7 +175,7 @@ public class TableElement extends PrintElement Integer nextRow = (Integer)m_pageBreak.get(i+1); if ((row.intValue()+1) == nextRow.intValue()) { - log.fine("- removing PageBreak row=" + row); + if (log.isLoggable(Level.FINE)) log.fine("- removing PageBreak row=" + row); m_pageBreak.remove(i); row = nextRow; } @@ -591,7 +591,7 @@ public class TableElement extends PrintElement // Page Layout ******************************************************* - log.fine("FirstPage=" + m_firstPage + ", NextPages=" + m_nextPages); + if (log.isLoggable(Level.FINE)) log.fine("FirstPage=" + m_firstPage + ", NextPages=" + m_nextPages); // One Page on Y | Axis if (m_firstPage.height >= p_height && m_pageBreak.size() == 0) { @@ -707,7 +707,7 @@ public class TableElement extends PrintElement } // for acc columns } // multiple - X pages - log.fine("Pages=" + getPageCount() + if (log.isLoggable(Level.FINE)) log.fine("Pages=" + getPageCount() + " X=" + m_firstColumnOnPage.size() + "/Y=" + m_firstRowOnPage.size() + " - Width=" + p_width + ", Height=" + p_height); return true; @@ -792,12 +792,12 @@ public class TableElement extends PrintElement public void setHeightToLastPage() { int lastLayoutPage = getPageCount() + m_pageNoStart - 1; - log.fine("PageCount - Table=" + getPageCount() + if (log.isLoggable(Level.FINE)) log.fine("PageCount - Table=" + getPageCount() + "(Start=" + m_pageNoStart + ") Layout=" + lastLayoutPage + " - Old Height=" + p_height); p_height = getHeight(lastLayoutPage); - log.fine("New Height=" + p_height); + if (log.isLoggable(Level.FINE)) log.fine("New Height=" + p_height); } // setHeightToLastPage @@ -895,14 +895,14 @@ public class TableElement extends PrintElement { int pageIndex = getPageIndex(pageNo); int pageYindex = getPageYIndex(pageIndex); - log.fine("Page=" + pageNo + " - PageIndex=" + pageIndex + if (log.isLoggable(Level.FINE)) log.fine("Page=" + pageNo + " - PageIndex=" + pageIndex + ", PageYindex=" + pageYindex); float pageHeight = ((Float)m_pageHeight.get(pageYindex)).floatValue(); float pageHeightPrevious = 0f; if (pageYindex > 0) pageHeightPrevious = ((Float)m_pageHeight.get(pageYindex-1)).floatValue(); float retValue = pageHeight - pageHeightPrevious; - log.fine("Page=" + pageNo + " - PageIndex=" + pageIndex + ", PageYindex=" + pageYindex + ", Height=" + String.valueOf(retValue)); + if (log.isLoggable(Level.FINE)) log.fine("Page=" + pageNo + " - PageIndex=" + pageIndex + ", PageYindex=" + pageYindex + ", Height=" + String.valueOf(retValue)); return retValue; } // getHeight @@ -1046,7 +1046,7 @@ public class TableElement extends PrintElement int col = getCol (relativePoint.x, pageNo); if (col == -1) return null; - log.fine("Row=" + row + ", Col=" + col + ", PageNo=" + pageNo); + if (log.isLoggable(Level.FINE)) log.fine("Row=" + row + ", Col=" + col + ", PageNo=" + pageNo); // NamePair pp = (NamePair)m_rowColDrillDown.get(new Point(row,col)); if (pp == null) @@ -1075,7 +1075,7 @@ public class TableElement extends PrintElement int row = getRow (relativePoint.y, pageNo); if (row == -1) return null; - log.fine("Row=" + row + ", PageNo=" + pageNo); + if (log.isLoggable(Level.FINE)) log.fine("Row=" + row + ", PageNo=" + pageNo); // if (m_pk[row] == null) // FunctionRows return null; @@ -1507,7 +1507,7 @@ public class TableElement extends PrintElement { String str = printItems[index].toString(); if (DEBUG_PRINT) - log.fine("row=" + row + ",col=" + col + " - " + str + " 8Bit=" + Util.is8Bit(str)); + if (log.isLoggable(Level.FINE)) log.fine("row=" + row + ",col=" + col + " - " + str + " 8Bit=" + Util.is8Bit(str)); if (str.length() > 0) { usedHeight = 0; @@ -1567,7 +1567,7 @@ public class TableElement extends PrintElement else layout.draw(g2D, penX, penY); // -> text if (DEBUG_PRINT) - log.fine("row=" + row + ",col=" + col + " - " + str + " - x=" + penX + ",y=" + penY); + if (log.isLoggable(Level.FINE)) log.fine("row=" + row + ",col=" + col + " - " + str + " - x=" + penX + ",y=" + penY); penY += layout.getDescent() + layout.getLeading(); usedHeight += lineHeight; // diff --git a/org.adempiere.base/src/org/compiere/process/AdempiereServer.java b/org.adempiere.base/src/org/compiere/process/AdempiereServer.java index 9cec70011b..f43e895e4c 100644 --- a/org.adempiere.base/src/org/compiere/process/AdempiereServer.java +++ b/org.adempiere.base/src/org/compiere/process/AdempiereServer.java @@ -224,7 +224,7 @@ public abstract class AdempiereServer extends Thread try { - log.fine("sleeping ... " + m_sleepSeconds); + if (log.isLoggable(Level.FINE)) log.fine("sleeping ... " + m_sleepSeconds); sleep (m_sleepSeconds*1000); } catch (InterruptedException e1) diff --git a/org.adempiere.base/src/org/compiere/process/FactReconciliation.java b/org.adempiere.base/src/org/compiere/process/FactReconciliation.java index 9471960791..3b111e4cdd 100644 --- a/org.adempiere.base/src/org/compiere/process/FactReconciliation.java +++ b/org.adempiere.base/src/org/compiere/process/FactReconciliation.java @@ -108,7 +108,7 @@ public class FactReconciliation extends SvrProcess rs = null; pstmt = null; } - log.fine((System.currentTimeMillis() - m_start) + " ms"); + if (log.isLoggable(Level.FINE)) log.fine((System.currentTimeMillis() - m_start) + " ms"); return ""; } // doIt diff --git a/org.adempiere.base/src/org/compiere/process/ServerProcessCtl.java b/org.adempiere.base/src/org/compiere/process/ServerProcessCtl.java index e866e8e1b2..1d098e7405 100644 --- a/org.adempiere.base/src/org/compiere/process/ServerProcessCtl.java +++ b/org.adempiere.base/src/org/compiere/process/ServerProcessCtl.java @@ -58,7 +58,7 @@ public class ServerProcessCtl implements Runnable { */ public static ServerProcessCtl process (ProcessInfo pi, Trx trx) { - log.fine("ServerProcess - " + pi); + if (log.isLoggable(Level.FINE)) log.fine("ServerProcess - " + pi); MPInstance instance = null; try @@ -118,7 +118,7 @@ public class ServerProcessCtl implements Runnable { */ public void run () { - log.fine("AD_PInstance_ID=" + m_pi.getAD_PInstance_ID() + if (log.isLoggable(Level.FINE)) log.fine("AD_PInstance_ID=" + m_pi.getAD_PInstance_ID() + ", Record_ID=" + m_pi.getRecord_ID()); // Get Process Information: Name, Procedure Name, ClassName, IsReport, IsDirectPrint @@ -296,7 +296,7 @@ public class ServerProcessCtl implements Runnable { */ protected boolean startWorkflow (int AD_Workflow_ID) { - log.fine(AD_Workflow_ID + " - " + m_pi); + if (log.isLoggable(Level.FINE)) log.fine(AD_Workflow_ID + " - " + m_pi); boolean started = false; if (m_IsServerProcess) { @@ -338,7 +338,7 @@ public class ServerProcessCtl implements Runnable { */ protected boolean startProcess () { - log.fine(m_pi.toString()); + if (log.isLoggable(Level.FINE)) log.fine(m_pi.toString()); boolean started = false; //hengsin, bug [ 1633995 ] @@ -411,7 +411,7 @@ public class ServerProcessCtl implements Runnable { protected boolean startDBProcess (String ProcedureName) { // execute on this thread/connection - log.fine(ProcedureName + "(" + m_pi.getAD_PInstance_ID() + ")"); + if (log.isLoggable(Level.FINE)) log.fine(ProcedureName + "(" + m_pi.getAD_PInstance_ID() + ")"); boolean started = false; if (m_IsServerProcess) { diff --git a/org.adempiere.base/src/org/compiere/process/SvrProcess.java b/org.adempiere.base/src/org/compiere/process/SvrProcess.java index 927867ff8f..5e147d559f 100644 --- a/org.adempiere.base/src/org/compiere/process/SvrProcess.java +++ b/org.adempiere.base/src/org/compiere/process/SvrProcess.java @@ -501,7 +501,7 @@ public abstract class SvrProcess implements ProcessCall */ private void lock() { - log.fine("AD_PInstance_ID=" + m_pi.getAD_PInstance_ID()); + if (log.isLoggable(Level.FINE)) log.fine("AD_PInstance_ID=" + m_pi.getAD_PInstance_ID()); try { DB.executeUpdate("UPDATE AD_PInstance SET IsProcessing='Y' WHERE AD_PInstance_ID=" @@ -530,7 +530,7 @@ public abstract class SvrProcess implements ProcessCall mpi.setResult(!m_pi.isError()); mpi.setErrorMsg(m_pi.getSummary()); mpi.saveEx(); - log.fine(mpi.toString()); + if (log.isLoggable(Level.FINE)) log.fine(mpi.toString()); ProcessInfoUtil.saveLogToDB(m_pi); } diff --git a/org.adempiere.base/src/org/compiere/report/FinReport.java b/org.adempiere.base/src/org/compiere/report/FinReport.java index 7873038b42..d20b049932 100644 --- a/org.adempiere.base/src/org/compiere/report/FinReport.java +++ b/org.adempiere.base/src/org/compiere/report/FinReport.java @@ -32,7 +32,6 @@ import org.compiere.print.MPrintFormatItem; import org.compiere.process.ProcessInfoParameter; import org.compiere.process.SvrProcess; import org.compiere.util.AdempiereUserError; -import org.compiere.util.CLogMgt; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Ini; @@ -287,7 +286,7 @@ public class FinReport extends SvrProcess + "WHERE IsActive='Y' AND PA_ReportLineSet_ID=").append(PA_ReportLineSet_ID); int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Report Lines = " + no); + if (log.isLoggable(Level.FINE)) log.fine("Report Lines = " + no); // ** Get Data ** Segment Values m_columns = m_report.getColumnSet().getColumns(); @@ -318,7 +317,7 @@ public class FinReport extends SvrProcess else getProcessInfo().setSerializableObject(getPrintFormat()); - log.fine((System.currentTimeMillis() - m_start) + " ms"); + if (log.isLoggable(Level.FINE)) log.fine((System.currentTimeMillis() - m_start) + " ms"); return ""; } // doIt @@ -509,7 +508,7 @@ public class FinReport extends SvrProcess int oper_1 = m_lines[line].getOper_1_ID(); int oper_2 = m_lines[line].getOper_2_ID(); - log.fine("Line " + line + " = #" + oper_1 + " " + if (log.isLoggable(Level.FINE)) log.fine("Line " + line + " = #" + oper_1 + " " + m_lines[line].getCalculationType() + " #" + oper_2); // Adding @@ -552,7 +551,7 @@ public class FinReport extends SvrProcess log.log(Level.SEVERE, "(+) #=" + no + " for " + m_lines[line] + " - " + sb.toString()); else { - log.fine("(+) Line=" + line + " - " + m_lines[line]); + if (log.isLoggable(Level.FINE)) log.fine("(+) Line=" + line + " - " + m_lines[line]); if (log.isLoggable(Level.FINEST)) log.finest ("(+) " + sb.toString ()); } } @@ -628,7 +627,7 @@ public class FinReport extends SvrProcess log.severe ("(x) #=" + no + " for " + m_lines[line] + " - " + sb.toString ()); else { - log.fine("(x) Line=" + line + " - " + m_lines[line]); + if (log.isLoggable(Level.FINE)) log.fine("(x) Line=" + line + " - " + m_lines[line]); if (log.isLoggable(Level.FINEST)) log.finest (sb.toString()); } } @@ -659,12 +658,12 @@ public class FinReport extends SvrProcess log.log(Level.SEVERE, "Column Index for Operator 2 not found - " + m_columns[col]); continue; } - log.fine("Column " + col + " = #" + ii_1 + " " + if (log.isLoggable(Level.FINE)) log.fine("Column " + col + " = #" + ii_1 + " " + m_columns[col].getCalculationType() + " #" + ii_2); // Reverse Range if (ii_1 > ii_2 && m_columns[col].isCalculationTypeRange()) { - log.fine("Swap operands from " + ii_1 + " op " + ii_2); + if (log.isLoggable(Level.FINE)) log.fine("Swap operands from " + ii_1 + " op " + ii_2); int temp = ii_1; ii_1 = ii_2; ii_2 = temp; @@ -704,7 +703,7 @@ public class FinReport extends SvrProcess + " - " + sb.toString()); else { - log.fine("Col=" + col + " - " + m_columns[col]); + if (log.isLoggable(Level.FINE)) log.fine("Col=" + col + " - " + m_columns[col]); if (log.isLoggable(Level.FINEST)) log.finest (sb.toString ()); } } // for all columns @@ -851,7 +850,7 @@ public class FinReport extends SvrProcess .append(" AND Col_0 IS NULL AND Col_1 IS NULL AND Col_2 IS NULL AND Col_3 IS NULL AND Col_4 IS NULL AND Col_5 IS NULL AND Col_6 IS NULL AND Col_7 IS NULL AND Col_8 IS NULL AND Col_9 IS NULL") .append(" AND Col_10 IS NULL AND Col_11 IS NULL AND Col_12 IS NULL AND Col_13 IS NULL AND Col_14 IS NULL AND Col_15 IS NULL AND Col_16 IS NULL AND Col_17 IS NULL AND Col_18 IS NULL AND Col_19 IS NULL AND Col_20 IS NULL"); int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Deleted empty #=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Deleted empty #=" + no); // Set SeqNo sql = new StringBuffer ("UPDATE T_Report r1 " @@ -861,7 +860,7 @@ public class FinReport extends SvrProcess + " AND r2.Record_ID=0 AND r2.Fact_Acct_ID=0)" + "WHERE SeqNo IS NULL"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("SeqNo #=" + no); + if (log.isLoggable(Level.FINE)) log.fine("SeqNo #=" + no); if (!m_report.isListTrx()) return; @@ -878,8 +877,7 @@ public class FinReport extends SvrProcess + "WHERE Fact_Acct_ID <> 0 AND AD_PInstance_ID=") .append(getAD_PInstance_ID()); no = DB.executeUpdate(sql.toString(), get_TrxName()); - if (CLogMgt.isLevelFinest()) - log.fine("Trx Name #=" + no + " - " + sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine("Trx Name #=" + no + " - " + sql.toString()); } // insertLineDetail /** @@ -898,7 +896,7 @@ public class FinReport extends SvrProcess String variable = m_lines[line].getSourceColumnName(); if (variable == null) return; - log.fine("Variable=" + variable); + if (log.isLoggable(Level.FINE)) log.fine("Variable=" + variable); // Insert StringBuffer insert = new StringBuffer("INSERT INTO T_Report " @@ -1020,8 +1018,7 @@ public class FinReport extends SvrProcess .append(" GROUP BY ").append(variable); int no = DB.executeUpdate(insert.toString(), get_TrxName()); - if (CLogMgt.isLevelFinest()) - log.fine("Source #=" + no + " - " + insert); + if (log.isLoggable(Level.FINE)) log.fine("Source #=" + no + " - " + insert); if (no == 0) return; @@ -1033,8 +1030,7 @@ public class FinReport extends SvrProcess .append(" AND PA_ReportLine_ID=").append(m_lines[line].getPA_ReportLine_ID()) .append(" AND Fact_Acct_ID=0"); no = DB.executeUpdate(sql.toString(), get_TrxName()); - if (CLogMgt.isLevelFinest()) - log.fine("Name #=" + no + " - " + sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine("Name #=" + no + " - " + sql.toString()); if (m_report.isListTrx()) insertLineTrx (line, variable); @@ -1134,7 +1130,7 @@ public class FinReport extends SvrProcess + " AND PA_ReportLine_ID=" + m_lines[line].getPA_ReportLine_ID(); int no = DB.executeUpdate(sql, get_TrxName()); if (no > 0) - log.fine(m_lines[line].getName() + " - #" + no); + if (log.isLoggable(Level.FINE)) log.fine(m_lines[line].getName() + " - #" + no); } } // for all lines } // deleteUnprintedLines @@ -1160,7 +1156,7 @@ public class FinReport extends SvrProcess + " WHERE AD_PInstance_ID=" + getAD_PInstance_ID(); int no = DB.executeUpdate(sql, get_TrxName()); if (no > 0) - log.fine(m_columns[column].getName() + " - #" + no); + if (log.isLoggable(Level.FINE)) log.fine(m_columns[column].getName() + " - #" + no); } } @@ -1200,7 +1196,7 @@ public class FinReport extends SvrProcess else if (!m_report.getDescription().equals(pf.getDescription())) pf.setDescription(m_report.getDescription()); pf.saveEx(); - log.fine(pf + " - #" + pf.getItemCount()); + if (log.isLoggable(Level.FINE)) log.fine(pf + " - #" + pf.getItemCount()); // Print Format Item Sync int count = pf.getItemCount(); @@ -1309,7 +1305,7 @@ public class FinReport extends SvrProcess pfi.setSortNo(0); } pfi.saveEx(); - log.fine(pfi.toString()); + if (log.isLoggable(Level.FINE)) log.fine(pfi.toString()); } // set translated to original pf.setTranslation(); diff --git a/org.adempiere.base/src/org/compiere/report/FinStatement.java b/org.adempiere.base/src/org/compiere/report/FinStatement.java index d9857e3b15..0268f0dc88 100644 --- a/org.adempiere.base/src/org/compiere/report/FinStatement.java +++ b/org.adempiere.base/src/org/compiere/report/FinStatement.java @@ -206,7 +206,7 @@ public class FinStatement extends SvrProcess setDateAcct(); sb.append(" - DateAcct ").append(p_DateAcct_From).append("-").append(p_DateAcct_To); sb.append(" - Where=").append(m_parameterWhere); - log.fine(sb.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sb.toString()); } // prepare /** @@ -280,7 +280,7 @@ public class FinStatement extends SvrProcess else getProcessInfo().setSerializableObject(MPrintFormat.get (getCtx(), AD_PrintFormat_ID, false)); - log.fine((System.currentTimeMillis() - m_start) + " ms"); + if (log.isLoggable(Level.FINE)) log.fine((System.currentTimeMillis() - m_start) + " ms"); return ""; } // doIt @@ -316,7 +316,7 @@ public class FinStatement extends SvrProcess } // int no = DB.executeUpdate(sb.toString(), get_TrxName()); - log.fine("#" + no + " (Account_ID=" + p_Account_ID + ")"); + if (log.isLoggable(Level.FINE)) log.fine("#" + no + " (Account_ID=" + p_Account_ID + ")"); if (log.isLoggable(Level.FINEST)) log.finest(sb.toString()); } // createBalanceLine @@ -338,7 +338,7 @@ public class FinStatement extends SvrProcess .append(" AND ").append(DB.TO_DATE(p_DateAcct_To)); // int no = DB.executeUpdate(sb.toString(), get_TrxName()); - log.fine("#" + no); + if (log.isLoggable(Level.FINE)) log.fine("#" + no); if (log.isLoggable(Level.FINEST)) log.finest(sb.toString()); // Set Name,Description @@ -364,7 +364,7 @@ public class FinStatement extends SvrProcess + "WHERE Fact_Acct_ID <> 0 AND AD_PInstance_ID=").append(getAD_PInstance_ID()); // no = DB.executeUpdate(sb.toString(), get_TrxName()); - log.fine("Name #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Name #" + no); if (log.isLoggable(Level.FINEST)) log.finest("Name - " + sb); } // createDetailLines diff --git a/org.adempiere.base/src/org/compiere/report/MReportColumn.java b/org.adempiere.base/src/org/compiere/report/MReportColumn.java index ed144a1b4e..76e6321be7 100644 --- a/org.adempiere.base/src/org/compiere/report/MReportColumn.java +++ b/org.adempiere.base/src/org/compiere/report/MReportColumn.java @@ -197,7 +197,7 @@ public class MReportColumn extends X_PA_ReportColumn if (ID == 0) { - log.fine("No Restrictions - No ID for EntityType=" + et); + if (log.isLoggable(Level.FINE)) log.fine("No Restrictions - No ID for EntityType=" + et); return ""; } diff --git a/org.adempiere.base/src/org/compiere/report/MReportTree.java b/org.adempiere.base/src/org/compiere/report/MReportTree.java index 7e6f9c5bc9..757bb59557 100644 --- a/org.adempiere.base/src/org/compiere/report/MReportTree.java +++ b/org.adempiere.base/src/org/compiere/report/MReportTree.java @@ -229,7 +229,7 @@ public class MReportTree */ public String getWhereClause (int ID) { - log.fine("(" + m_ElementType + ") ID=" + ID); + if (log.isLoggable(Level.FINE)) log.fine("(" + m_ElementType + ") ID=" + ID); String ColumnName = MAcctSchemaElement.getColumnName(m_ElementType); // MTreeNode node = m_tree.getRoot().findNode(ID); @@ -277,7 +277,7 @@ public class MReportTree */ public Integer[] getChildIDs (int ID) { - log.fine("(" + m_ElementType + ") ID=" + ID); + if (log.isLoggable(Level.FINE)) log.fine("(" + m_ElementType + ") ID=" + ID); ArrayList list = new ArrayList(); // MTreeNode node = m_tree.getRoot().findNode(ID); diff --git a/org.adempiere.base/src/org/compiere/report/TrialBalance.java b/org.adempiere.base/src/org/compiere/report/TrialBalance.java index e1f5646a21..c56209d4fc 100644 --- a/org.adempiere.base/src/org/compiere/report/TrialBalance.java +++ b/org.adempiere.base/src/org/compiere/report/TrialBalance.java @@ -211,7 +211,7 @@ public class TrialBalance extends SvrProcess setDateAcct(); sb.append(" - DateAcct ").append(p_DateAcct_From).append("-").append(p_DateAcct_To); sb.append(" - Where=").append(m_parameterWhere); - log.fine(sb.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sb.toString()); } // prepare /** @@ -282,7 +282,7 @@ public class TrialBalance extends SvrProcess // int AD_PrintFormat_ID = 134; // getProcessInfo().setTransientObject (MPrintFormat.get (getCtx(), AD_PrintFormat_ID, false)); - log.fine((System.currentTimeMillis() - m_start) + " ms"); + if (log.isLoggable(Level.FINE)) log.fine((System.currentTimeMillis() - m_start) + " ms"); return ""; } // doIt @@ -409,8 +409,8 @@ public class TrialBalance extends SvrProcess // int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no == 0) - log.fine(sql.toString()); - log.fine("#" + no + " (Account_ID=" + p_Account_ID + ")"); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine("#" + no + " (Account_ID=" + p_Account_ID + ")"); } // createBalanceLine /** @@ -447,8 +447,8 @@ public class TrialBalance extends SvrProcess // int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no == 0) - log.fine(sql.toString()); - log.fine("#" + no + " (Account_ID=" + p_Account_ID + ")"); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine("#" + no + " (Account_ID=" + p_Account_ID + ")"); // Update AccountValue String sql2 = "UPDATE T_TrialBalance tb SET AccountValue = " @@ -456,7 +456,7 @@ public class TrialBalance extends SvrProcess + "WHERE tb.Account_ID IS NOT NULL AND tb.AD_PInstance_ID = " + getAD_PInstance_ID(); no = DB.executeUpdate(sql2, get_TrxName()); if (no > 0) - log.fine("Set AccountValue #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set AccountValue #" + no); } // createDetailLines diff --git a/org.adempiere.base/src/org/compiere/report/core/RModel.java b/org.adempiere.base/src/org/compiere/report/core/RModel.java index 6c499447fd..dd1ada7c34 100644 --- a/org.adempiere.base/src/org/compiere/report/core/RModel.java +++ b/org.adempiere.base/src/org/compiere/report/core/RModel.java @@ -170,7 +170,7 @@ public class RModel implements Serializable // log.fine( "Column " + i + " " + rc.getColSQL() + " ? " + columnName); if (rc.getColSQL().startsWith(columnName)) { - log.fine( "Column " + i + " " + rc.getColSQL() + " = " + columnName); + if (log.isLoggable(Level.FINE)) log.fine( "Column " + i + " " + rc.getColSQL() + " = " + columnName); return i; } } diff --git a/org.adempiere.base/src/org/compiere/report/core/RModelData.java b/org.adempiere.base/src/org/compiere/report/core/RModelData.java index a7f79c0ba8..6f5291e61b 100644 --- a/org.adempiere.base/src/org/compiere/report/core/RModelData.java +++ b/org.adempiere.base/src/org/compiere/report/core/RModelData.java @@ -189,7 +189,7 @@ public class RModelData */ private void process() { - log.fine("Start Rows=" + m_rows.size()); + if (log.isLoggable(Level.FINE)) log.fine("Start Rows=" + m_rows.size()); // Row level Funcions // would come here @@ -203,7 +203,7 @@ public class RModelData { groupBys[i] = groups.get(i).intValue(); groupBysValue[i] = INITVALUE; - log.fine("GroupBy level=" + i + " col=" + groupBys[i]); + if (log.isLoggable(Level.FINE)) log.fine("GroupBy level=" + i + " col=" + groupBys[i]); } // Add additional row to force group change if (gSize > 0) @@ -225,12 +225,12 @@ public class RModelData Object key = it.next(); funcCols[index] = ((Integer)key).intValue(); funcFuns[index] = functions.get(key).toString(); - log.fine("Function " + funcFuns[index] + " col=" + funcCols[index]); + if (log.isLoggable(Level.FINE)) log.fine("Function " + funcFuns[index] + " col=" + funcCols[index]); index++; } BigDecimal[][] funcVals = new BigDecimal [fSize][gSize+1]; int totalIndex = gSize; // place for overall total - log.fine("FunctionValues = [ " + fSize + " * " + (gSize+1) + " ]"); + if (log.isLoggable(Level.FINE)) log.fine("FunctionValues = [ " + fSize + " * " + (gSize+1) + " ]"); for (int f = 0; f < fSize; f++) for (int g = 0; g < gSize+1; g++) funcVals[f][g] = Env.ZERO; @@ -353,7 +353,7 @@ public class RModelData m_groupRows.add(new Integer(rows.size())); // group row indicator rows.add(newRow); } - log.fine("End Rows=" + rows.size()); + if (log.isLoggable(Level.FINE)) log.fine("End Rows=" + rows.size()); m_rows.clear(); } // process diff --git a/org.adempiere.base/src/org/compiere/util/CacheMgt.java b/org.adempiere.base/src/org/compiere/util/CacheMgt.java index f59a86c648..a42a76470f 100644 --- a/org.adempiere.base/src/org/compiere/util/CacheMgt.java +++ b/org.adempiere.base/src/org/compiere/util/CacheMgt.java @@ -22,6 +22,7 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; +import java.util.logging.Level; import org.adempiere.base.IServiceHolder; import org.adempiere.base.Service; @@ -221,12 +222,12 @@ public class CacheMgt CacheInterface stored = (CacheInterface)m_instances.get(i); if (stored != null && stored.size() > 0) { - log.fine(stored.toString()); + if (log.isLoggable(Level.FINE)) log.fine(stored.toString()); total += stored.reset(); counter++; } } - log.fine("#" + counter + " (" + total + ")"); + if (log.isLoggable(Level.FINE)) log.fine("#" + counter + " (" + total + ")"); return total; } @@ -254,14 +255,14 @@ public class CacheMgt if (cc.getTableName() != null && cc.getTableName().startsWith(tableName)) // reset lines/dependent too { { - log.fine("(all) - " + stored); + if (log.isLoggable(Level.FINE)) log.fine("(all) - " + stored); total += stored.reset(Record_ID); counter++; } } } } - log.fine(tableName + ": #" + counter + " (" + total + ")"); + if (log.isLoggable(Level.FINE)) log.fine(tableName + ": #" + counter + " (" + total + ")"); return total; } @@ -308,7 +309,7 @@ public class CacheMgt CacheInterface stored = (CacheInterface)m_instances.get(i); if (stored != null && stored.size() > 0) { - log.fine(stored.toString()); + if (log.isLoggable(Level.FINE)) log.fine(stored.toString()); if (stored instanceof CCache) total += ((CCache)stored).sizeNoExpire(); else diff --git a/org.adempiere.base/src/org/compiere/util/DB.java b/org.adempiere.base/src/org/compiere/util/DB.java index 58793bb66a..a6c8bb04bf 100644 --- a/org.adempiere.base/src/org/compiere/util/DB.java +++ b/org.adempiere.base/src/org/compiere/util/DB.java @@ -227,7 +227,7 @@ public final class DB .append(", RequestUserPW=").append(DB.TO_STRING(mailPassword)) .append(", IsSMTPAuthorization='Y' WHERE AD_Client_ID=0"); int no = DB.executeUpdate(sql.toString(), null); - log.fine("Client #"+no); + if (log.isLoggable(Level.FINE)) log.fine("Client #"+no); // sql = new StringBuffer("UPDATE AD_User SET ") .append(" EMail=").append(DB.TO_STRING(adminEMail)) @@ -235,7 +235,7 @@ public final class DB .append(", EMailUserPW=").append(DB.TO_STRING(mailPassword)) .append(" WHERE AD_User_ID IN (0,100)"); no = DB.executeUpdate(sql.toString(), null); - log.fine("User #"+no); + if (log.isLoggable(Level.FINE)) log.fine("User #"+no); // try { @@ -1219,7 +1219,7 @@ public final class DB String statements[] = sql.split(SQLSTATEMENT_SEPARATOR); for (int i = 0; i < statements.length; i++) { - log.fine(statements[i]); + if (log.isLoggable(Level.FINE)) log.fine(statements[i]); no += executeUpdate(statements[i], null, ignoreError, trxName); } @@ -1354,7 +1354,7 @@ public final class DB if (rs.next()) retValue = rs.getInt(1); else - log.fine("No Value " + sql); + if (log.isLoggable(Level.FINE)) log.fine("No Value " + sql); } catch (SQLException e) { @@ -1435,7 +1435,7 @@ public final class DB if (rs.next()) retValue = rs.getString(1); else - log.fine("No Value " + sql); + if (log.isLoggable(Level.FINE)) log.fine("No Value " + sql); } catch (SQLException e) { @@ -1516,7 +1516,7 @@ public final class DB if (rs.next()) retValue = rs.getBigDecimal(1); else - log.fine("No Value " + sql); + if (log.isLoggable(Level.FINE)) log.fine("No Value " + sql); } catch (SQLException e) { @@ -1599,7 +1599,7 @@ public final class DB if (rs.next()) retValue = rs.getTimestamp(1); else - log.fine("No Value " + sql); + if (log.isLoggable(Level.FINE)) log.fine("No Value " + sql); } catch (SQLException e) { @@ -1982,7 +1982,7 @@ public final class DB C_DocType_ID = Env.getContextAsInt(ctx, WindowNo + "|C_DocType_ID"); if (C_DocType_ID == 0) { - log.fine("Window=" + WindowNo + if (log.isLoggable(Level.FINE)) log.fine("Window=" + WindowNo + " - Target=" + Env.getContextAsInt(ctx, WindowNo + "|C_DocTypeTarget_ID") + "/" + Env.getContextAsInt(ctx, WindowNo, "C_DocTypeTarget_ID") + " - Actual=" + Env.getContextAsInt(ctx, WindowNo + "|C_DocType_ID") + "/" + Env.getContextAsInt(ctx, WindowNo, "C_DocType_ID")); return getDocumentNo (AD_Client_ID, TableName, trxName); diff --git a/org.adempiere.base/src/org/compiere/util/EMail.java b/org.adempiere.base/src/org/compiere/util/EMail.java index 2fee23e3f6..a46a44b5db 100644 --- a/org.adempiere.base/src/org/compiere/util/EMail.java +++ b/org.adempiere.base/src/org/compiere/util/EMail.java @@ -325,7 +325,7 @@ public final class EMail implements Serializable // log.fine("transport connected"); Transport.send(m_msg); // t.sendMessage(msg, msg.getAllRecipients()); - log.fine("Success - MessageID=" + m_msg.getMessageID()); + if (log.isLoggable(Level.FINE)) log.fine("Success - MessageID=" + m_msg.getMessageID()); } catch (MessagingException me) { @@ -462,7 +462,7 @@ public final class EMail implements Serializable { Enumeration e = m_msg.getAllHeaderLines (); while (e.hasMoreElements ()) - log.fine("- " + e.nextElement ()); + if (log.isLoggable(Level.FINE)) log.fine("- " + e.nextElement ()); } catch (MessagingException ex) { @@ -924,7 +924,7 @@ public final class EMail implements Serializable m_msg.setDataHandler (new DataHandler (new ByteArrayDataSource (m_messageHTML, charSetName, "text/html"))); // - log.fine("(simple) " + getSubject()); + if (log.isLoggable(Level.FINE)) log.fine("(simple) " + getSubject()); } else // Multi part message *************************************** { @@ -940,7 +940,7 @@ public final class EMail implements Serializable // Create Multipart and its parts to it Multipart mp = new MimeMultipart(); mp.addBodyPart(mbp_1); - log.fine("(multi) " + getSubject() + " - " + mbp_1); + if (log.isLoggable(Level.FINE)) log.fine("(multi) " + getSubject() + " - " + mbp_1); // for all attachments for (int i = 0; i < m_attachments.size(); i++) @@ -974,7 +974,7 @@ public final class EMail implements Serializable MimeBodyPart mbp_2 = new MimeBodyPart(); mbp_2.setDataHandler(new DataHandler(ds)); mbp_2.setFileName(ds.getName()); - log.fine("Added Attachment " + ds.getName() + " - " + mbp_2); + if (log.isLoggable(Level.FINE)) log.fine("Added Attachment " + ds.getName() + " - " + mbp_2); mp.addBodyPart(mbp_2); } diff --git a/org.adempiere.base/src/org/compiere/util/FileUpload.java b/org.adempiere.base/src/org/compiere/util/FileUpload.java index c666223f24..e3ea5b131c 100644 --- a/org.adempiere.base/src/org/compiere/util/FileUpload.java +++ b/org.adempiere.base/src/org/compiere/util/FileUpload.java @@ -155,7 +155,7 @@ public class FileUpload String contentType = request.getContentType(); int index = contentType.lastIndexOf('='); String boundary = contentType.substring(index+1); - log.fine(formDataLength + " - " + boundary); + if (log.isLoggable(Level.FINE)) log.fine(formDataLength + " - " + boundary); int sizeKB = formDataLength/1024; if (sizeKB > MAX_KB) // 250k { @@ -187,7 +187,7 @@ public class FileUpload if (index < 1) return "No File Name"; m_fileName = m_fileName.substring(0, index); - log.fine("upload - " + m_fileName); + if (log.isLoggable(Level.FINE)) log.fine("upload - " + m_fileName); // Content: @@ -207,7 +207,7 @@ public class FileUpload int posEnd = m_requestDataString.indexOf(boundary, posStart)-4; int length = posEnd-posStart; // - log.fine("uploadFile - Start=" + posStart + ", End=" + posEnd + ", Length=" + length); + if (log.isLoggable(Level.FINE)) log.fine("uploadFile - Start=" + posStart + ", End=" + posEnd + ", Length=" + length); // Final copy m_data = new byte[length]; @@ -250,7 +250,7 @@ public class FileUpload log.warning("getParameter Not found - " + parameterName); return null; } - log.fine("getParameter = " + parameterName + "=" + retValue); + if (log.isLoggable(Level.FINE)) log.fine("getParameter = " + parameterName + "=" + retValue); return retValue; } // getMultiPartParameter diff --git a/org.adempiere.base/src/org/compiere/util/Login.java b/org.adempiere.base/src/org/compiere/util/Login.java index 675fc44fc3..61fa32cb82 100644 --- a/org.adempiere.base/src/org/compiere/util/Login.java +++ b/org.adempiere.base/src/org/compiere/util/Login.java @@ -410,7 +410,7 @@ public class Login // retValue = new KeyNamePair[list.size()]; list.toArray(retValue); - log.fine("User=" + app_user + " - roles #" + retValue.length); + if (log.isLoggable(Level.FINE)) log.fine("User=" + app_user + " - roles #" + retValue.length); } @@ -493,7 +493,7 @@ public class Login // retValue = new KeyNamePair[list.size()]; list.toArray(retValue); - log.fine("Role: " + role.toStringX() + " - clients #" + retValue.length); + if (log.isLoggable(Level.FINE)) log.fine("Role: " + role.toStringX() + " - clients #" + retValue.length); } catch (SQLException ex) { @@ -589,7 +589,7 @@ public class Login retValue = new KeyNamePair[list.size()]; list.toArray(retValue); - log.fine("Client: " + AD_Client_ID +", AD_Role_ID=" + rol.getName()+", AD_User_ID=" + AD_User_ID+" - orgs #" + retValue.length); + if (log.isLoggable(Level.FINE)) log.fine("Client: " + AD_Client_ID +", AD_Role_ID=" + rol.getName()+", AD_User_ID=" + AD_User_ID+" - orgs #" + retValue.length); } catch (SQLException ex) { @@ -723,7 +723,7 @@ public class Login // retValue = new KeyNamePair[list.size()]; list.toArray(retValue); - log.fine("Org: " + org.toStringX() + if (log.isLoggable(Level.FINE)) log.fine("Org: " + org.toStringX() + " - warehouses #" + retValue.length); } catch (SQLException ex) @@ -1388,7 +1388,7 @@ public class Login } retValue = new KeyNamePair[clientList.size()]; clientList.toArray(retValue); - log.fine("User=" + app_user + " - roles #" + retValue.length); + if (log.isLoggable(Level.FINE)) log.fine("User=" + app_user + " - roles #" + retValue.length); for (MUser user : users) { @@ -1510,7 +1510,7 @@ public class Login // retValue = new KeyNamePair[rolesList.size()]; rolesList.toArray(retValue); - log.fine("Role: " + client.toStringX() + " - clients #" + retValue.length); + if (log.isLoggable(Level.FINE)) log.fine("Role: " + client.toStringX() + " - clients #" + retValue.length); } catch (SQLException ex) { diff --git a/org.adempiere.base/src/org/compiere/util/Task.java b/org.adempiere.base/src/org/compiere/util/Task.java index 807c765316..16f03f55ec 100644 --- a/org.adempiere.base/src/org/compiere/util/Task.java +++ b/org.adempiere.base/src/org/compiere/util/Task.java @@ -142,7 +142,7 @@ public class Task extends Thread try { if (m_child != null) - log.fine("run - ExitValue=" + m_child.exitValue()); + if (log.isLoggable(Level.FINE)) log.fine("run - ExitValue=" + m_child.exitValue()); } catch (Exception e) {} log.config("done"); diff --git a/org.adempiere.base/src/org/compiere/util/Trace.java b/org.adempiere.base/src/org/compiere/util/Trace.java index 9d3a70506f..9a0b96abe4 100644 --- a/org.adempiere.base/src/org/compiere/util/Trace.java +++ b/org.adempiere.base/src/org/compiere/util/Trace.java @@ -17,6 +17,7 @@ package org.compiere.util; import java.util.ArrayList; +import java.util.logging.Level; /** * Trace Information @@ -112,7 +113,7 @@ public class Trace || (adempiereOnly && elements[i].getClassName().startsWith("org.compiere")) ) { - log.fine(i + ": " + elements[i]); + if (log.isLoggable(Level.FINE)) log.fine(i + ": " + elements[i]); if (first9only && ++counter > 8) break; } diff --git a/org.adempiere.base/src/org/compiere/util/WebInfo.java b/org.adempiere.base/src/org/compiere/util/WebInfo.java index 721f164c75..e1c0b5958b 100644 --- a/org.adempiere.base/src/org/compiere/util/WebInfo.java +++ b/org.adempiere.base/src/org/compiere/util/WebInfo.java @@ -258,7 +258,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getOrders @@ -299,7 +299,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("C_Order_ID=" + m_id + " - " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("C_Order_ID=" + m_id + " - " + retValue); return retValue; } // getOrder @@ -342,7 +342,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getShipments @@ -414,7 +414,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("Own=" + own +" #" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("Own=" + own +" #" + list.size()); return list; } // getRequests @@ -452,7 +452,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("R_Request_ID=" + m_id + " - " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("R_Request_ID=" + m_id + " - " + retValue); return retValue; } // getRequest @@ -486,7 +486,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getRequestTypes @@ -518,7 +518,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("R_RequestType_ID=" + m_id + " - " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("R_RequestType_ID=" + m_id + " - " + retValue); return retValue; } // getRequestType @@ -561,7 +561,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getInvoices @@ -603,7 +603,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("C_Invoice_ID=" + m_id + " - " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("C_Invoice_ID=" + m_id + " - " + retValue); return retValue; } // getInvoice @@ -644,7 +644,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getPayments @@ -689,7 +689,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getAssets @@ -730,7 +730,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getInterests @@ -762,7 +762,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getAdvertisement @@ -793,7 +793,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getAllAds @@ -832,7 +832,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getCommissionedInvoices @@ -867,7 +867,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getCommissionRuns @@ -902,7 +902,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getNotes @@ -937,7 +937,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("AD_Note_ID=" + m_id + " - " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("AD_Note_ID=" + m_id + " - " + retValue); return retValue; } // getNote @@ -972,7 +972,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getActivities @@ -1007,7 +1007,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("AD_WF_Activity_ID=" + m_id + " - " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("AD_WF_Activity_ID=" + m_id + " - " + retValue); return retValue; } // getActivity @@ -1042,7 +1042,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getExpenses @@ -1078,7 +1078,7 @@ public class WebInfo } if (retValue == null) retValue = new MTimeExpense (m_ctx, 0, null); - log.fine("S_TimeExpense_ID=" + m_id + " - " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("S_TimeExpense_ID=" + m_id + " - " + retValue); return retValue; } // getExpense @@ -1113,7 +1113,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getRegistrations @@ -1150,7 +1150,7 @@ public class WebInfo // new registration if (retValue == null) retValue = new MRegistration (m_ctx, 0, null); - log.fine("A_Registration_ID=" + m_id + " - " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("A_Registration_ID=" + m_id + " - " + retValue); return retValue; } // getRegistration @@ -1193,7 +1193,7 @@ public class WebInfo DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + list.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + list.size()); return list; } // getRfQs @@ -1245,7 +1245,7 @@ public class WebInfo } } // - log.fine("C_RfQResponse_ID=" + m_id + " - " + retValue); + if (log.isLoggable(Level.FINE)) log.fine("C_RfQResponse_ID=" + m_id + " - " + retValue); return retValue; } // getRfQResponse diff --git a/org.adempiere.base/src/org/compiere/util/WebLogin.java b/org.adempiere.base/src/org/compiere/util/WebLogin.java index 1b288eaffe..e9d713b306 100644 --- a/org.adempiere.base/src/org/compiere/util/WebLogin.java +++ b/org.adempiere.base/src/org/compiere/util/WebLogin.java @@ -239,7 +239,7 @@ public class WebLogin else { m_forward = getLogin_RelURL (); - log.fine("- PasswordMessage=" + m_wu.getPasswordMessage()); + if (log.isLoggable(Level.FINE)) log.fine("- PasswordMessage=" + m_wu.getPasswordMessage()); } // If no session exists or is not loaded, load or create it if (m_session==null) @@ -285,7 +285,7 @@ public class WebLogin } // if (passwordChange) - log.fine("- update Pwd " + m_email + ", Old=" + m_password + ", DB=" + m_wu.getPassword() + ", New=" + passwordNew); + if (log.isLoggable(Level.FINE)) log.fine("- update Pwd " + m_email + ", Old=" + m_password + ", DB=" + m_wu.getPassword() + ", New=" + passwordNew); if (WebUtil.updateFields(m_request, m_wu, passwordChange)) { if (passwordChange) @@ -306,7 +306,7 @@ public class WebLogin } else // new { - log.fine("** new " + m_email + "/" + m_password); + if (log.isLoggable(Level.FINE)) log.fine("** new " + m_email + "/" + m_password); m_wu.setEmail (m_email); m_wu.setPassword (m_password); if (WebUtil.updateFields (m_request, m_wu, true)) @@ -326,7 +326,7 @@ public class WebLogin } else { - log.fine("- failed - " + m_wu.getSaveErrorMessage() + " - " + m_wu.getPasswordMessage()); + if (log.isLoggable(Level.FINE)) log.fine("- failed - " + m_wu.getSaveErrorMessage() + " - " + m_wu.getPasswordMessage()); m_forward = getLogin_RelURL (); } } // new diff --git a/org.adempiere.base/src/org/compiere/util/WebSessionCtx.java b/org.adempiere.base/src/org/compiere/util/WebSessionCtx.java index 343168b8c2..8bbc21814d 100644 --- a/org.adempiere.base/src/org/compiere/util/WebSessionCtx.java +++ b/org.adempiere.base/src/org/compiere/util/WebSessionCtx.java @@ -134,7 +134,7 @@ public class WebSessionCtx implements Serializable // Make Context directly availabe to jsp's session.setAttribute("ctx", ctx); // - log.fine("#" + ctx.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + ctx.size()); } // WebSessionCtx /************************************************************************** @@ -169,7 +169,7 @@ public class WebSessionCtx implements Serializable // Make Context directly availabe to jsp's session.setAttribute("ctx", ctx); // - log.fine("#" + ctx.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + ctx.size()); } // WebSessionCtx /** Sessition Attribute Name */ diff --git a/org.adempiere.base/src/org/compiere/util/WebUser.java b/org.adempiere.base/src/org/compiere/util/WebUser.java index c54dc9a1fa..138a77df97 100644 --- a/org.adempiere.base/src/org/compiere/util/WebUser.java +++ b/org.adempiere.base/src/org/compiere/util/WebUser.java @@ -183,7 +183,7 @@ public class WebUser if (rs.next()) { m_bpc = new MUser (m_ctx, rs, null); - log.fine("Found BPC=" + m_bpc); + if (log.isLoggable(Level.FINE)) log.fine("Found BPC=" + m_bpc); } } catch (Exception e) @@ -217,7 +217,7 @@ public class WebUser if (m_bpc != null) { m_bp = new MBPartner (m_ctx, m_bpc.getC_BPartner_ID (), null); - log.fine("Found BP=" + m_bp); + if (log.isLoggable(Level.FINE)) log.fine("Found BP=" + m_bp); } else m_bp = null; @@ -227,7 +227,7 @@ public class WebUser if (m_bpc.getC_BPartner_Location_ID() != 0) { m_bpl = new MBPartnerLocation (m_ctx, m_bpc.getC_BPartner_Location_ID (), null); - log.fine("Found BPL=" + m_bpl); + if (log.isLoggable(Level.FINE)) log.fine("Found BPL=" + m_bpl); } else { @@ -235,13 +235,13 @@ public class WebUser if (bpls != null && bpls.length > 0) { m_bpl = bpls[0]; - log.fine("Found BPL=" + m_bpl); + if (log.isLoggable(Level.FINE)) log.fine("Found BPL=" + m_bpl); } } if (m_bpl != null) { m_loc = MLocation.get (m_ctx, m_bpl.getC_Location_ID(), null); - log.fine("Found LOC=" + m_loc); + if (log.isLoggable(Level.FINE)) log.fine("Found LOC=" + m_loc); } else m_loc = null; @@ -295,7 +295,7 @@ public class WebUser if (rs.next()) { m_bpc = new MUser (m_ctx, rs, null); - log.fine("= found BPC=" + m_bpc); + if (log.isLoggable(Level.FINE)) log.fine("= found BPC=" + m_bpc); } } catch (Exception e) @@ -316,7 +316,7 @@ public class WebUser if (m_bpc != null) { m_bp = new MBPartner (m_ctx, m_bpc.getC_BPartner_ID (), null); - log.fine("= Found BP=" + m_bp); + if (log.isLoggable(Level.FINE)) log.fine("= Found BP=" + m_bp); } else m_bp = null; @@ -326,7 +326,7 @@ public class WebUser if (m_bpc.getC_BPartner_Location_ID() != 0) { m_bpl = new MBPartnerLocation (m_ctx, m_bpc.getC_BPartner_Location_ID (), null); - log.fine("= Found BPL=" + m_bpl); + if (log.isLoggable(Level.FINE)) log.fine("= Found BPL=" + m_bpl); } else { @@ -334,13 +334,13 @@ public class WebUser if (bpls != null && bpls.length > 0) { m_bpl = bpls[0]; - log.fine("= Found BPL=" + m_bpl); + if (log.isLoggable(Level.FINE)) log.fine("= Found BPL=" + m_bpl); } } if (m_bpl != null) { m_loc = MLocation.get (m_ctx, m_bpl.getC_Location_ID(), null); - log.fine("= Found LOC=" + m_loc); + if (log.isLoggable(Level.FINE)) log.fine("= Found LOC=" + m_loc); } else m_loc = null; @@ -392,14 +392,14 @@ public class WebUser { if (m_bpc == null || !WebUtil.exists(getEmail())) { - log.fine(getEmail() + ", bpc=" + m_bpc); + if (log.isLoggable(Level.FINE)) log.fine(getEmail() + ", bpc=" + m_bpc); return false; } // boolean ok = m_bpc.getAD_User_ID() != 0 && m_bpc.isEMailValid(); if (!ok) - log.fine(getEmail() + if (log.isLoggable(Level.FINE)) log.fine(getEmail() + ", ID=" + m_bpc.getAD_User_ID() + ", Online=" + m_bpc.isOnline() + ", EMailValid=" + m_bpc.isEMailValid()); @@ -460,7 +460,7 @@ public class WebUser if (rs.next()) { m_bp = new MBPartner (m_ctx, m_bpc.getC_BPartner_ID (), null); - log.fine("BP loaded =" + m_bp); + if (log.isLoggable(Level.FINE)) log.fine("BP loaded =" + m_bp); } } catch (Exception e) @@ -479,7 +479,7 @@ public class WebUser m_bp.setName (m_bpc.getName()); if (m_bp.getValue() == null || m_bp.getValue().length() == 0) m_bp.setValue(m_bpc.getEMail()); - log.fine("BP=" + m_bp); + if (log.isLoggable(Level.FINE)) log.fine("BP=" + m_bp); if (!m_bp.save ()) { m_saveErrorMessage = "Could not save Business Partner"; @@ -487,7 +487,7 @@ public class WebUser } // save Location *************************************** - log.fine("LOC=" + m_loc); + if (log.isLoggable(Level.FINE)) log.fine("LOC=" + m_loc); m_loc.save (); // save BP Location *************************************** @@ -495,7 +495,7 @@ public class WebUser m_bpl.setC_BPartner_ID (m_bp.getC_BPartner_ID()); if (m_bpl.getC_Location_ID () != m_loc.getC_Location_ID()) m_bpl.setC_Location_ID (m_loc.getC_Location_ID()); - log.fine("BPL=" + m_bpl); + if (log.isLoggable(Level.FINE)) log.fine("BPL=" + m_bpl); if (!m_bpl.save ()) { m_saveErrorMessage = "Could not save Location"; @@ -507,7 +507,7 @@ public class WebUser m_bpc.setC_BPartner_ID (m_bp.getC_BPartner_ID()); if (m_bpc.getC_BPartner_Location_ID () != m_bpl.getC_BPartner_Location_ID ()) m_bpc.setC_BPartner_Location_ID (m_bpl.getC_BPartner_Location_ID ()); - log.fine("BPC=" + m_bpc); + if (log.isLoggable(Level.FINE)) log.fine("BPC=" + m_bpc); if (!m_bpc.save ()) { m_saveErrorMessage = "Could not save Contact"; @@ -752,7 +752,7 @@ public class WebUser } m_loggedIn=m_loggedIn && retValue; setPasswordOK (m_loggedIn, password); - log.fine("success=" + m_loggedIn); + if (log.isLoggable(Level.FINE)) log.fine("success=" + m_loggedIn); if (m_loggedIn) Env.setContext(m_ctx, "#AD_User_ID", getAD_User_ID()); return m_loggedIn; diff --git a/org.adempiere.base/src/org/compiere/util/WebUtil.java b/org.adempiere.base/src/org/compiere/util/WebUtil.java index d469428928..dd4778cb5e 100644 --- a/org.adempiere.base/src/org/compiere/util/WebUtil.java +++ b/org.adempiere.base/src/org/compiere/util/WebUtil.java @@ -380,7 +380,7 @@ public final class WebUtil } catch (Exception e) { - log.fine(parameter + "=" + data + " - " + e); + if (log.isLoggable(Level.FINE)) log.fine(parameter + "=" + data + " - " + e); } return Env.ZERO; } // getParameterAsBD @@ -652,7 +652,7 @@ public final class WebUtil if (out.checkError()) log.log(Level.SEVERE, "Error writing"); out.close(); - log.fine(forwardURL + " - " + title); + if (log.isLoggable(Level.FINE)) log.fine(forwardURL + " - " + title); } // createForwardPage @@ -930,7 +930,7 @@ public final class WebUtil } if (realIndex < 0) { - log.fine("No Attachment Entry for Index=" + if (log.isLoggable(Level.FINE)) log.fine("No Attachment Entry for Index=" + attachmentIndex + " - " + attachment); return "Attachment Entry not found"; } @@ -938,7 +938,7 @@ public final class WebUtil MAttachmentEntry entry = entries[realIndex]; if (entry.getData() == null) { - log.fine("Empty Attachment Entry for Index=" + if (log.isLoggable(Level.FINE)) log.fine("Empty Attachment Entry for Index=" + attachmentIndex + " - " + attachment); return "Attachment Entry empty"; } @@ -953,7 +953,7 @@ public final class WebUtil response.setBufferSize(bufferSize); response.setContentLength(fileLength); // - log.fine(entry.toString()); + if (log.isLoggable(Level.FINE)) log.fine(entry.toString()); long time = System.currentTimeMillis(); // timer start // ServletOutputStream out = response.getOutputStream (); @@ -1001,7 +1001,7 @@ public final class WebUtil response.setBufferSize(bufferSize); response.setContentLength(fileLength); // - log.fine(file.toString()); + if (log.isLoggable(Level.FINE)) log.fine(file.toString()); long time = System.currentTimeMillis(); // timer start // Get Data FileInputStream in = new FileInputStream(file); diff --git a/org.adempiere.base/src/org/compiere/wf/DocWorkflowManager.java b/org.adempiere.base/src/org/compiere/wf/DocWorkflowManager.java index 3705691ab5..667b893fa7 100644 --- a/org.adempiere.base/src/org/compiere/wf/DocWorkflowManager.java +++ b/org.adempiere.base/src/org/compiere/wf/DocWorkflowManager.java @@ -109,12 +109,12 @@ public class DocWorkflowManager implements DocWorkflowMgr boolean sql = logic.startsWith("SQL="); if (sql && !testStart(wf, document)) { - log.fine("SQL Logic evaluated to false (" + logic + ")"); + if (log.isLoggable(Level.FINE)) log.fine("SQL Logic evaluated to false (" + logic + ")"); continue; } if (!sql && !Evaluator.evaluateLogic(document, logic)) { - log.fine("Logic evaluated to false (" + logic + ")"); + if (log.isLoggable(Level.FINE)) log.fine("Logic evaluated to false (" + logic + ")"); continue; } diff --git a/org.adempiere.base/src/org/compiere/wf/MWFActivity.java b/org.adempiere.base/src/org/compiere/wf/MWFActivity.java index aebfc1fcba..109b1f45a2 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWFActivity.java +++ b/org.adempiere.base/src/org/compiere/wf/MWFActivity.java @@ -264,7 +264,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable if (m_state.isValidNewState(WFState)) { String oldState = getWFState(); - log.fine(oldState + "->"+ WFState + ", Msg=" + getTextMsg()); + if (log.isLoggable(Level.FINE)) log.fine(oldState + "->"+ WFState + ", Msg=" + getTextMsg()); super.setWFState (WFState); m_state = new StateEngine (getWFState()); saveEx(); // closed in MWFProcess.checkActivities() @@ -667,7 +667,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable break; } oldUser = user; - log.fine("User=" + user.getName()); + if (log.isLoggable(Level.FINE)) log.fine("User=" + user.getName()); // Get Roles of User MRole[] roles = user.getRoles(AD_Org_ID); for (int i = 0; i < roles.length; i++) @@ -688,7 +688,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable continue; } boolean approved = amount.compareTo(roleAmt) <= 0; - log.fine("Approved=" + approved + if (log.isLoggable(Level.FINE)) log.fine("Approved=" + approved + " - User=" + user.getName() + ", Role=" + role.getName() + ", ApprovalAmt=" + roleAmt); if (approved) { @@ -717,7 +717,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable if (user.getSupervisor_ID() != 0) { user = MUser.get(getCtx(), user.getSupervisor_ID()); - log.fine("Supervisor: " + user.getName()); + if (log.isLoggable(Level.FINE)) log.fine("Supervisor: " + user.getName()); } else { @@ -728,7 +728,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable if (orgInfo.getSupervisor_ID() != 0) { user = MUser.get(getCtx(), orgInfo.getSupervisor_ID()); - log.fine("Org=" + org.getName() + ",Supervisor: " + user.getName()); + if (log.isLoggable(Level.FINE)) log.fine("Org=" + org.getName() + ",Supervisor: " + user.getName()); } else { @@ -741,7 +741,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable if (orgInfo.getSupervisor_ID() != 0) { user = MUser.get(getCtx(), orgInfo.getSupervisor_ID()); - log.fine("Parent Org Supervisor: " + user.getName()); + if (log.isLoggable(Level.FINE)) log.fine("Parent Org Supervisor: " + user.getName()); } } } @@ -959,7 +959,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable /****** Sleep (Start/End) ******/ if (MWFNode.ACTION_WaitSleep.equals(action)) { - log.fine("Sleep:WaitTime=" + m_node.getWaitTime()); + if (log.isLoggable(Level.FINE)) log.fine("Sleep:WaitTime=" + m_node.getWaitTime()); if (m_node.getWaitTime() == 0) // IDEMPIERE-73 Carlos Ruiz - globalqss return true; // done Calendar cal = Calendar.getInstance(); @@ -971,7 +971,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable /****** Document Action ******/ else if (MWFNode.ACTION_DocumentAction.equals(action)) { - log.fine("DocumentAction=" + m_node.getDocAction()); + if (log.isLoggable(Level.FINE)) log.fine("DocumentAction=" + m_node.getDocAction()); getPO(trx); if (m_po == null) throw new Exception("Persistent Object not found - AD_Table_ID=" @@ -1029,7 +1029,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable /****** Report ******/ else if (MWFNode.ACTION_AppsReport.equals(action)) { - log.fine("Report:AD_Process_ID=" + m_node.getAD_Process_ID()); + if (log.isLoggable(Level.FINE)) log.fine("Report:AD_Process_ID=" + m_node.getAD_Process_ID()); // Process MProcess process = MProcess.get(getCtx(), m_node.getAD_Process_ID()); process.set_TrxName(trx != null ? trx.getTrxName() : null); @@ -1067,7 +1067,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable /****** Process ******/ else if (MWFNode.ACTION_AppsProcess.equals(action)) { - log.fine("Process:AD_Process_ID=" + m_node.getAD_Process_ID()); + if (log.isLoggable(Level.FINE)) log.fine("Process:AD_Process_ID=" + m_node.getAD_Process_ID()); // Process MProcess process = MProcess.get(getCtx(), m_node.getAD_Process_ID()); MPInstance pInstance = new MPInstance(process, getRecord_ID()); @@ -1094,7 +1094,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable /****** EMail ******/ else if (MWFNode.ACTION_EMail.equals(action)) { - log.fine ("EMail:EMailRecipient=" + m_node.getEMailRecipient()); + if (log.isLoggable(Level.FINE)) log.fine ("EMail:EMailRecipient=" + m_node.getEMailRecipient()); getPO(trx); if (m_po == null) throw new Exception("Persistent Object not found - AD_Table_ID=" @@ -1126,7 +1126,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable else if (MWFNode.ACTION_SetVariable.equals(action)) { String value = m_node.getAttributeValue(); - log.fine("SetVariable:AD_Column_ID=" + m_node.getAD_Column_ID() + if (log.isLoggable(Level.FINE)) log.fine("SetVariable:AD_Column_ID=" + m_node.getAD_Column_ID() + " to " + value); MColumn column = m_node.getColumn(); int dt = column.getAD_Reference_ID(); @@ -1143,7 +1143,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable /****** User Choice ******/ else if (MWFNode.ACTION_UserChoice.equals(action)) { - log.fine("UserChoice:AD_Column_ID=" + m_node.getAD_Column_ID()); + if (log.isLoggable(Level.FINE)) log.fine("UserChoice:AD_Column_ID=" + m_node.getAD_Column_ID()); // Approval if (m_node.isUserApproval() && getPO(trx) instanceof DocAction) @@ -1213,13 +1213,13 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable /****** User Form ******/ else if (MWFNode.ACTION_UserForm.equals(action)) { - log.fine("Form:AD_Form_ID=" + m_node.getAD_Form_ID()); + if (log.isLoggable(Level.FINE)) log.fine("Form:AD_Form_ID=" + m_node.getAD_Form_ID()); return false; } /****** User Window ******/ else if (MWFNode.ACTION_UserWindow.equals(action)) { - log.fine("Window:AD_Window_ID=" + m_node.getAD_Window_ID()); + if (log.isLoggable(Level.FINE)) log.fine("Window:AD_Window_ID=" + m_node.getAD_Window_ID()); return false; } // @@ -1496,7 +1496,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable if (iPara.getParameterName().equals(nPara.getAttributeName())) { String variableName = nPara.getAttributeValue(); - log.fine(nPara.getAttributeName() + if (log.isLoggable(Level.FINE)) log.fine(nPara.getAttributeName() + " = " + variableName); // Value - Constant/Variable Object value = variableName; @@ -1544,7 +1544,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable log.warning(nPara.getAttributeName() + " - empty - mandatory!"); else - log.fine(nPara.getAttributeName() + if (log.isLoggable(Level.FINE)) log.fine(nPara.getAttributeName() + " - empty"); break; } @@ -1563,7 +1563,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable else bd = new BigDecimal (value.toString()); iPara.setP_Number(bd); - log.fine(nPara.getAttributeName() + if (log.isLoggable(Level.FINE)) log.fine(nPara.getAttributeName() + " = " + variableName + " (=" + bd + "=)"); } else if (DisplayType.isDate(nPara.getDisplayType())) @@ -1574,13 +1574,13 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable else ts = Timestamp.valueOf(value.toString()); iPara.setP_Date(ts); - log.fine(nPara.getAttributeName() + if (log.isLoggable(Level.FINE)) log.fine(nPara.getAttributeName() + " = " + variableName + " (=" + ts + "=)"); } else { iPara.setP_String(value.toString()); - log.fine(nPara.getAttributeName() + if (log.isLoggable(Level.FINE)) log.fine(nPara.getAttributeName() + " = " + variableName + " (=" + value + "=) " + value.getClass().getName()); } @@ -1668,7 +1668,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable { MOrgInfo org = MOrgInfo.get(getCtx(), m_po.getAD_Org_ID(), get_TrxName()); if (org.getSupervisor_ID() == 0) - log.fine("No Supervisor for AD_Org_ID=" + m_po.getAD_Org_ID()); + if (log.isLoggable(Level.FINE)) log.fine("No Supervisor for AD_Org_ID=" + m_po.getAD_Org_ID()); else sendEMail(client, org.getSupervisor_ID(), null, subject, message, pdf, text.isHtml()); } diff --git a/org.adempiere.base/src/org/compiere/wf/MWFNextCondition.java b/org.adempiere.base/src/org/compiere/wf/MWFNextCondition.java index 77b9e6ef1a..1204fc4f6b 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWFNextCondition.java +++ b/org.adempiere.base/src/org/compiere/wf/MWFNextCondition.java @@ -19,6 +19,7 @@ package org.compiere.wf; import java.math.BigDecimal; import java.sql.ResultSet; import java.util.Properties; +import java.util.logging.Level; import org.compiere.model.PO; import org.compiere.model.X_AD_WF_NextCondition; @@ -111,7 +112,7 @@ public class MWFNextCondition extends X_AD_WF_NextCondition else result = compareString(valueObj, value1, value2); // - log.fine(resultStr + " -> " + result + if (log.isLoggable(Level.FINE)) log.fine(resultStr + " -> " + result + (m_numeric ? " (#)" : " ($)")); return result; } // evaluate @@ -166,7 +167,7 @@ public class MWFNextCondition extends X_AD_WF_NextCondition } catch (Exception e) { - log.fine("compareNumber - valueObj=" + valueObj + " - " + e.toString()); + if (log.isLoggable(Level.FINE)) log.fine("compareNumber - valueObj=" + valueObj + " - " + e.toString()); return compareString(valueObj, value1, value2); } try @@ -175,7 +176,7 @@ public class MWFNextCondition extends X_AD_WF_NextCondition } catch (Exception e) { - log.fine("compareNumber - value1=" + value1 + " - " + e.toString()); + if (log.isLoggable(Level.FINE)) log.fine("compareNumber - value1=" + value1 + " - " + e.toString()); return compareString(valueObj, value1, value2); } @@ -210,7 +211,7 @@ public class MWFNextCondition extends X_AD_WF_NextCondition } catch (Exception e) { - log.fine("compareNumber - value2=" + value2 + " - " + e.toString()); + if (log.isLoggable(Level.FINE)) log.fine("compareNumber - value2=" + value2 + " - " + e.toString()); return false; } } diff --git a/org.adempiere.base/src/org/compiere/wf/MWFNode.java b/org.adempiere.base/src/org/compiere/wf/MWFNode.java index fac1a00a93..961cd2bc76 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWFNode.java +++ b/org.adempiere.base/src/org/compiere/wf/MWFNode.java @@ -25,6 +25,7 @@ import java.sql.Timestamp; import java.util.ArrayList; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import org.adempiere.exceptions.DBException; import org.compiere.model.MColumn; @@ -183,7 +184,7 @@ public class MWFNode extends X_AD_WF_Node { next.setFromSplitAnd(splitAnd); } - log.fine("#" + m_next.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_next.size()); } // loadNext /** @@ -221,7 +222,7 @@ public class MWFNode extends X_AD_WF_Node DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("Trl=" + m_translated); + if (log.isLoggable(Level.FINE)) log.fine("Trl=" + m_translated); } // loadTrl /** diff --git a/org.adempiere.base/src/org/compiere/wf/MWFNodeNext.java b/org.adempiere.base/src/org/compiere/wf/MWFNodeNext.java index 46faa4af47..12d64953bf 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWFNodeNext.java +++ b/org.adempiere.base/src/org/compiere/wf/MWFNodeNext.java @@ -19,6 +19,7 @@ package org.compiere.wf; import java.sql.ResultSet; import java.util.List; import java.util.Properties; +import java.util.logging.Level; import org.compiere.model.PO; import org.compiere.model.Query; @@ -176,7 +177,7 @@ public class MWFNodeNext extends X_AD_WF_NodeNext || DocAction.ACTION_Unlock.equals(docAction) || DocAction.ACTION_Invalidate.equals(docAction) ) */ { - log.fine("isValidFor =NO= StdUserWF - Status=" + docStatus + " - Action=" + docAction); + if (log.isLoggable(Level.FINE)) log.fine("isValidFor =NO= StdUserWF - Status=" + docStatus + " - Action=" + docAction); return false; } } @@ -184,7 +185,7 @@ public class MWFNodeNext extends X_AD_WF_NodeNext // No Conditions if (getConditions(false).length == 0) { - log.fine("#0 " + toString()); + if (log.isLoggable(Level.FINE)) log.fine("#0 " + toString()); return true; } // First condition always AND @@ -196,7 +197,7 @@ public class MWFNodeNext extends X_AD_WF_NodeNext else ok = ok && m_conditions[i].evaluate(activity); } // for all conditions - log.fine("isValidFor (" + ok + ") " + toString()); + if (log.isLoggable(Level.FINE)) log.fine("isValidFor (" + ok + ") " + toString()); return ok; } // isValidFor diff --git a/org.adempiere.base/src/org/compiere/wf/MWFProcess.java b/org.adempiere.base/src/org/compiere/wf/MWFProcess.java index 27036a8e51..6c1fecd759 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWFProcess.java +++ b/org.adempiere.base/src/org/compiere/wf/MWFProcess.java @@ -339,7 +339,7 @@ public class MWFProcess extends X_AD_WF_Process */ private boolean startNext (MWFActivity last, MWFActivity[] activities, PO lastPO, String trxName) { - log.fine("Last=" + last); + if (log.isLoggable(Level.FINE)) log.fine("Last=" + last); // transitions from the last processed node MWFNodeNext[] transitions = getWorkflow().getNodeNexts( last.getAD_WF_Node_ID(), last.getPO_AD_Client_ID()); @@ -488,7 +488,7 @@ public class MWFProcess extends X_AD_WF_Process return false; } int AD_WF_Node_ID = getWorkflow().getAD_WF_Node_ID(); - log.fine("AD_WF_Node_ID=" + AD_WF_Node_ID); + if (log.isLoggable(Level.FINE)) log.fine("AD_WF_Node_ID=" + AD_WF_Node_ID); setWFState(WFSTATE_Running); try { diff --git a/org.adempiere.base/src/org/compiere/wf/MWorkflow.java b/org.adempiere.base/src/org/compiere/wf/MWorkflow.java index 8839bc8a0d..ef3808db89 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWorkflow.java +++ b/org.adempiere.base/src/org/compiere/wf/MWorkflow.java @@ -237,7 +237,7 @@ public class MWorkflow extends X_AD_Workflow DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("Translated=" + m_translated); + if (log.isLoggable(Level.FINE)) log.fine("Translated=" + m_translated); } // loadTrl /** @@ -249,7 +249,7 @@ public class MWorkflow extends X_AD_Workflow .setParameters(new Object[]{get_ID()}) .setOnlyActiveRecords(true) .list(); - log.fine("#" + m_nodes.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_nodes.size()); } // loadNodes @@ -614,7 +614,7 @@ public class MWorkflow extends X_AD_Workflow */ protected boolean afterSave (boolean newRecord, boolean success) { - log.fine("Success=" + success); + if (log.isLoggable(Level.FINE)) log.fine("Success=" + success); if (!success) { return false; diff --git a/org.adempiere.base/src/org/eevolution/model/MDDOrder.java b/org.adempiere.base/src/org/eevolution/model/MDDOrder.java index e763b7a502..d99c38bbf3 100644 --- a/org.adempiere.base/src/org/eevolution/model/MDDOrder.java +++ b/org.adempiere.base/src/org/eevolution/model/MDDOrder.java @@ -571,7 +571,7 @@ public class MDDOrder extends X_DD_Order implements DocAction + "' WHERE DD_Order_ID=" + getDD_Order_ID(); int noLine = DB.executeUpdate("UPDATE DD_OrderLine " + set, get_TrxName()); m_lines = null; - log.fine("setProcessed - " + processed + " - Lines=" + noLine); + if (log.isLoggable(Level.FINE)) log.fine("setProcessed - " + processed + " - Lines=" + noLine); } // setProcessed @@ -665,7 +665,7 @@ public class MDDOrder extends X_DD_Order implements DocAction + "FROM DD_Order o WHERE i.DD_Order_ID=o.DD_Order_ID) " + "WHERE DocStatus NOT IN ('RE','CL') AND DD_Order_ID=" + getDD_Order_ID(); int no = DB.executeUpdate(sql, get_TrxName()); - log.fine("Description -> #" + no); + if (log.isLoggable(Level.FINE)) log.fine("Description -> #" + no); } // Sync Lines @@ -692,7 +692,7 @@ public class MDDOrder extends X_DD_Order implements DocAction { line.set_ValueOfColumn(columnName, get_Value(columnName)); line.saveEx(); - log.fine(columnName + " Lines -> #" + get_Value(columnName)); + if (log.isLoggable(Level.FINE)) log.fine(columnName + " Lines -> #" + get_Value(columnName)); } } } // afterSaveSync @@ -866,7 +866,7 @@ public class MDDOrder extends X_DD_Order implements DocAction continue; } - log.fine("Line=" + line.getLine() + if (log.isLoggable(Level.FINE)) log.fine("Line=" + line.getLine() + " - Ordered=" + line.getQtyOrdered() + ",Reserved=" + line.getQtyReserved() + ",Delivered=" + line.getQtyDelivered()); diff --git a/org.adempiere.base/src/org/eevolution/process/ImportInventoryMove.java b/org.adempiere.base/src/org/eevolution/process/ImportInventoryMove.java index 771b0b8057..115c00ade5 100644 --- a/org.adempiere.base/src/org/eevolution/process/ImportInventoryMove.java +++ b/org.adempiere.base/src/org/eevolution/process/ImportInventoryMove.java @@ -112,7 +112,7 @@ public class ImportInventoryMove extends SvrProcess move.deleteEx(true); no++; } - log.fine("Delete Old Impored =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Impored =" + no); } fillIDValues(); diff --git a/org.adempiere.base/src/org/idempiere/fa/feature/UseLifeImpl.java b/org.adempiere.base/src/org/idempiere/fa/feature/UseLifeImpl.java index be12b9e4ee..213214b5ef 100644 --- a/org.adempiere.base/src/org/idempiere/fa/feature/UseLifeImpl.java +++ b/org.adempiere.base/src/org/idempiere/fa/feature/UseLifeImpl.java @@ -5,6 +5,7 @@ package org.idempiere.fa.feature; import java.sql.Timestamp; import java.util.Properties; +import java.util.logging.Level; import org.compiere.model.GridField; import org.compiere.model.GridTab; @@ -13,7 +14,6 @@ import org.compiere.model.MAssetGroup; import org.compiere.model.PO; import org.compiere.model.SetGetModel; import org.compiere.model.SetGetUtil; -import org.compiere.util.CLogMgt; import org.compiere.util.CLogger; import org.compiere.util.Msg; import org.compiere.util.TimeUtil; @@ -114,10 +114,10 @@ public class UseLifeImpl * @param value use life months */ public void setUseLifeMonths(int value) { - if(CLogMgt.isLevelFine()) log.fine("Entering: value=" + value + ", " + this); + if (log.isLoggable(Level.FINE)) log.fine("Entering: value=" + value + ", " + this); m_obj.set_AttrValue(getFieldName(FIELD_UseLifeMonths, fiscal), Integer.valueOf(value)); m_obj.set_AttrValue(getFieldName(FIELD_UseLifeYears, fiscal), Integer.valueOf(value/12)); - if(CLogMgt.isLevelFine()) log.fine("Leaving: value=" + value + ", " + this); + if (log.isLoggable(Level.FINE)) log.fine("Leaving: value=" + value + ", " + this); } /** @@ -135,10 +135,10 @@ public class UseLifeImpl * @param value use life years */ public void setUseLifeYears(int value) { - if(CLogMgt.isLevelFine()) log.fine("Entering: value=" + value + ", " + this); + if (log.isLoggable(Level.FINE)) log.fine("Entering: value=" + value + ", " + this); m_obj.set_AttrValue(getFieldName(FIELD_UseLifeYears, fiscal), Integer.valueOf(value)); m_obj.set_AttrValue(getFieldName(FIELD_UseLifeMonths, fiscal), Integer.valueOf(value*12)); - if(CLogMgt.isLevelFine()) log.fine("Leaving: value=" + value + ", " + this); + if (log.isLoggable(Level.FINE)) log.fine("Leaving: value=" + value + ", " + this); } /** @@ -162,8 +162,7 @@ public class UseLifeImpl int uselife = (reset ? 0 : getUseLifeYears()); int new_uselife = uselife + deltaUseLifeYears; setUseLifeYears(new_uselife); - if(CLogMgt.isLevelFine()) - log.fine("UseLifeYears=" + uselife + ", delta=" + deltaUseLifeYears + " => new UseLifeYears=" + new_uselife + " (isFiscal=" + isFiscal() + ")"); + if (log.isLoggable(Level.FINE)) log.fine("UseLifeYears=" + uselife + ", delta=" + deltaUseLifeYears + " => new UseLifeYears=" + new_uselife + " (isFiscal=" + isFiscal() + ")"); } /** @@ -219,7 +218,7 @@ public class UseLifeImpl /** Validates and corrects errors in model */ public boolean validate(boolean saveError) { - if(CLogMgt.isLevelFine()) log.fine("Entering: " + this); + if (log.isLoggable(Level.FINE)) log.fine("Entering: " + this); int useLifeYears = 0; int useLifeMonths = 0; @@ -250,12 +249,12 @@ public class UseLifeImpl /* commented by @win MAssetClass assetClass = MAssetClass.get(getCtx(), A_Asset_Class_ID); if (assetClass != null && !assetClass.validate(this)) { - log.fine("Leaving [RETURN FALSE]"); + if (log.isLoggable(Level.FINE)) log.fine("Leaving [RETURN FALSE]"); return false; } */ //end comment by @win - log.fine("Leaving [RETURN TRUE]"); + if (log.isLoggable(Level.FINE)) log.fine("Leaving [RETURN TRUE]"); return true; } @@ -315,7 +314,7 @@ public class UseLifeImpl } /* commented out by @win String errmsg = assetClass.validate(false, UseLifeMonths, AssetServiceDate); - if(CLogMgt.isLevelFine()) log.fine("assetClass=" + assetClass + ", UseLifeMonths=" + UseLifeMonths + ", AssetServiceDate=" + AssetServiceDate + ", errmsg=" + errmsg); + if(CLogMgt.isLevelFine()) if (log.isLoggable(Level.FINE)) log.fine("assetClass=" + assetClass + ", UseLifeMonths=" + UseLifeMonths + ", AssetServiceDate=" + AssetServiceDate + ", errmsg=" + errmsg); return errmsg; */ // end comment by @win return NO_ERROR; //added by @win @@ -396,12 +395,12 @@ public class UseLifeImpl String errmsg = NO_ERROR; int A_Asset_Class_ID = -1; String columnName = mField.getColumnName(); - if(CLogMgt.isLevelFine()) log.fine("Entering: columnName: " + columnName + ", value=" + value); + if(CLogMgt.isLevelFine()) if (log.isLoggable(Level.FINE)) log.fine("Entering: columnName: " + columnName + ", value=" + value); if (value != null && value instanceof Number) { A_Asset_Class_ID = ((Number)value).intValue(); } - if(CLogMgt.isLevelFine()) log.fine("A_Asset_Class_ID=" + A_Asset_Class_ID); + if(CLogMgt.isLevelFine()) if (log.isLoggable(Level.FINE)) log.fine("A_Asset_Class_ID=" + A_Asset_Class_ID); if (A_Asset_Class_ID > 0) { MAssetClass assetClass = MAssetClass.get(ctx, A_Asset_Class_ID); @@ -414,10 +413,10 @@ public class UseLifeImpl else { errmsg = assetClass.validate(false, UseLifeMonths, AssetServiceDate); } - if(CLogMgt.isLevelFine()) log.fine("assetClass=" + assetClass + ", UseLifeMonths=" + UseLifeMonths + ", AssetServiceDate=" + AssetServiceDate + ", errmsg=" + errmsg); + if(CLogMgt.isLevelFine()) if (log.isLoggable(Level.FINE)) log.fine("assetClass=" + assetClass + ", UseLifeMonths=" + UseLifeMonths + ", AssetServiceDate=" + AssetServiceDate + ", errmsg=" + errmsg); } - if(CLogMgt.isLevelFine()) log.fine("Leaving: errmsg=" + errmsg); + if(CLogMgt.isLevelFine()) if (log.isLoggable(Level.FINE)) log.fine("Leaving: errmsg=" + errmsg); return errmsg; } */ // end commented by @win diff --git a/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java b/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java index 612b8520c1..8d512d556c 100644 --- a/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java +++ b/org.adempiere.base/src/org/idempiere/fa/process/ImportFixedAsset.java @@ -88,7 +88,7 @@ public class ImportFixedAsset extends SvrProcess sql = new StringBuffer ("DELETE "+X_I_FixedAsset.Table_Name + " WHERE I_IsImported='Y'").append (sqlCheck); no = DB.executeUpdateEx(sql.toString(), get_TrxName()); - log.fine("Delete Old Imported =" + no); + if (log.isLoggable(Level.FINE)) log.fine("Delete Old Imported =" + no); } // Set Client, Org, IsActive, Created/Updated @@ -131,7 +131,7 @@ public class ImportFixedAsset extends SvrProcess + "WHERE A_Asset_Group_ID IS NULL AND A_Asset_Group_Value IS NOT NULL" + " AND I_IsImported<>'Y'").append (sqlCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Asset Group from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Asset Group from Value=" + no); // Check if Asset Group Have Asset Group Acct Record sql = new StringBuffer ("UPDATE "+MIFixedAsset.Table_Name+" ifa " @@ -161,7 +161,7 @@ public class ImportFixedAsset extends SvrProcess + "WHERE C_BPartnerSR_ID IS NULL AND BPartner_Value IS NOT NULL" + " AND I_IsImported<>'Y'").append (sqlCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set BP from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set BP from Value=" + no); // City From Value sql = new StringBuffer ("UPDATE "+MIFixedAsset.Table_Name+" ifa " @@ -170,7 +170,7 @@ public class ImportFixedAsset extends SvrProcess + "WHERE C_City_ID IS NULL AND C_City_Value IS NOT NULL" + " AND I_IsImported<>'Y'").append (sqlCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set City from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set City from Value=" + no); // Product sql = new StringBuffer ("UPDATE "+MIFixedAsset.Table_Name+" ifa " @@ -179,7 +179,7 @@ public class ImportFixedAsset extends SvrProcess + "WHERE M_Product_ID IS NULL AND ProductValue IS NOT NULL" + " AND I_IsImported<>'Y'").append (sqlCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Product from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Product from Value=" + no); sql = new StringBuffer ("UPDATE "+MIFixedAsset.Table_Name+" ifa " + "SET I_IsImported='N', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Product, ' " @@ -208,7 +208,7 @@ public class ImportFixedAsset extends SvrProcess + "WHERE M_Locator_ID IS NULL AND LocatorValue IS NOT NULL" + " AND I_IsImported<>'Y'").append (sqlCheck); no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("Set Locator from Value=" + no); + if (log.isLoggable(Level.FINE)) log.fine("Set Locator from Value=" + no); //-- New BPartner --------------------------------------------------- diff --git a/org.adempiere.install/src/org/compiere/install/ConfigurationData.java b/org.adempiere.install/src/org/compiere/install/ConfigurationData.java index c31c87754e..5e2e7549fa 100644 --- a/org.adempiere.install/src/org/compiere/install/ConfigurationData.java +++ b/org.adempiere.install/src/org/compiere/install/ConfigurationData.java @@ -729,7 +729,7 @@ public class ConfigurationData } catch (Exception ex) { - log.fine("Not used=" + url); // ok + if (log.isLoggable(Level.FINE)) log.fine("Not used=" + url); // ok return false; } return true; @@ -746,7 +746,7 @@ public class ConfigurationData try { ServerSocket ss = new ServerSocket (port); - log.fine(ss.getInetAddress() + ":" + ss.getLocalPort() + " - created"); + if (log.isLoggable(Level.FINE)) log.fine(ss.getInetAddress() + ":" + ss.getLocalPort() + " - created"); ss.close(); } catch (Exception ex) @@ -778,13 +778,13 @@ public class ConfigurationData if (shouldBeUsed) log.warning("Open Socket " + host + ":" + port + " - " + e.getMessage()); else - log.fine(host + ":" + port + " - " + e.getMessage()); + if (log.isLoggable(Level.FINE)) log.fine(host + ":" + port + " - " + e.getMessage()); return false; } if (!shouldBeUsed) log.warning("Open Socket " + host + ":" + port + " - " + pingSocket); - log.fine(host + ":" + port + " - " + pingSocket); + if (log.isLoggable(Level.FINE)) log.fine(host + ":" + port + " - " + pingSocket); // success try { diff --git a/org.adempiere.install/src/org/compiere/install/KeyStoreMgt.java b/org.adempiere.install/src/org/compiere/install/KeyStoreMgt.java index 9a6bc7bba9..eea526b75b 100644 --- a/org.adempiere.install/src/org/compiere/install/KeyStoreMgt.java +++ b/org.adempiere.install/src/org/compiere/install/KeyStoreMgt.java @@ -151,7 +151,7 @@ public class KeyStoreMgt // Load Existing if (m_file.exists()) { - log.fine(m_file.toString()); + if (log.isLoggable(Level.FINE)) log.fine(m_file.toString()); InputStream is = null; try { @@ -175,7 +175,7 @@ public class KeyStoreMgt else return null; // does not exist // - log.fine("Provider=" + m_keyStore.getProvider() + if (log.isLoggable(Level.FINE)) log.fine("Provider=" + m_keyStore.getProvider() + " - Type=" + m_keyStore.getType()); // return m_keyStore; @@ -194,19 +194,19 @@ public class KeyStoreMgt Date date = m_keyStore.getCreationDate(alias); if (date == null) // no certificate return null; - log.fine("Created=" + date); + if (log.isLoggable(Level.FINE)) log.fine("Created=" + date); // Key key = m_keyStore.getKey(alias, m_password); if (CLogMgt.isLevelFinest()) log.info("Key=" + key); // Multiple lines else - log.fine(key.getAlgorithm()); + if (log.isLoggable(Level.FINE)) log.fine(key.getAlgorithm()); // Certificate cert = m_keyStore.getCertificate(alias); if (CLogMgt.isLevelFinest()) log.info("Certificate = " + cert); // Multiple lines else - log.fine(cert.getType()); + if (log.isLoggable(Level.FINE)) log.fine(cert.getType()); // log.fine("Certificate - Type=" + cert.getType() // + " - PublicKey=" + cert.getPublicKey()); diff --git a/org.adempiere.payment.processor/src/org/compiere/model/PP_Optimal.java b/org.adempiere.payment.processor/src/org/compiere/model/PP_Optimal.java index 0cff0e7860..1fd385f86e 100644 --- a/org.adempiere.payment.processor/src/org/compiere/model/PP_Optimal.java +++ b/org.adempiere.payment.processor/src/org/compiere/model/PP_Optimal.java @@ -191,7 +191,7 @@ public class PP_Optimal extends PaymentProcessor public boolean processCC () throws IllegalArgumentException { - log.fine(p_mbap.getHostAddress() + ":" + p_mbap.getHostPort() + ", Timeout=" + getTimeout() + if (log.isLoggable(Level.FINE)) log.fine(p_mbap.getHostAddress() + ":" + p_mbap.getHostPort() + ", Timeout=" + getTimeout() + "; Proxy=" + p_mbap.getProxyAddress() + ":" + p_mbap.getProxyPort() + " " + p_mbap.getProxyLogon() + " " + p_mbap.getProxyPassword()); setEncoded(true); @@ -236,7 +236,7 @@ public class PP_Optimal extends PaymentProcessor try { - log.fine("-> " + param.toString()); + if (log.isLoggable(Level.FINE)) log.fine("-> " + param.toString()); Properties prop = getConnectPostProperties(urlString, param.toString()); m_ok = prop != null; // authCode=, authTime=1132330817, subErrorString=Card has expired: 04/04, errCode=91, clientVersion=1.1, status=E, subError=0, actionCode=CP, errString=Invalid Payment Information. Please verify request parameters. @@ -268,7 +268,7 @@ public class PP_Optimal extends PaymentProcessor @SuppressWarnings("unused") String cvdInfo = prop.getProperty(CVD_INFO); - log.fine("<- Status=" + status + ", AuthCode=" + authCode + ", Error=" + errString); + if (log.isLoggable(Level.FINE)) log.fine("<- Status=" + status + ", AuthCode=" + authCode + ", Error=" + errString); } if (!m_ok) log.warning("<- " + prop); diff --git a/org.adempiere.payment.processor/src/org/compiere/model/PP_PayFlowPro.java b/org.adempiere.payment.processor/src/org/compiere/model/PP_PayFlowPro.java index 3c69ddb70e..3a6789abd7 100644 --- a/org.adempiere.payment.processor/src/org/compiere/model/PP_PayFlowPro.java +++ b/org.adempiere.payment.processor/src/org/compiere/model/PP_PayFlowPro.java @@ -83,7 +83,7 @@ public final class PP_PayFlowPro extends PaymentProcessor */ public boolean processCC () throws IllegalArgumentException { - log.fine(p_mbap.getHostAddress() + " " + p_mbap.getHostPort() + ", Timeout=" + getTimeout() + if (log.isLoggable(Level.FINE)) log.fine(p_mbap.getHostAddress() + " " + p_mbap.getHostPort() + ", Timeout=" + getTimeout() + "; Proxy=" + p_mbap.getProxyAddress() + " " + p_mbap.getProxyPort() + " " + p_mbap.getProxyLogon() + " " + p_mbap.getProxyPassword()); // StringBuilder param = new StringBuilder(); @@ -155,7 +155,7 @@ public final class PP_PayFlowPro extends PaymentProcessor .append("&VENDOR=").append(p_mbap.getVendorID()) .append("&USER=").append(p_mbap.getUserID()) .append("&PWD=").append(p_mbap.getPassword()); - log.fine("-> " + param.toString()); + if (log.isLoggable(Level.FINE)) log.fine("-> " + param.toString()); // Call the PayFlowPro client. int rc = m_pp.CreateContext (p_mbap.getHostAddress(), p_mbap.getHostPort(), getTimeout(), @@ -164,7 +164,7 @@ public final class PP_PayFlowPro extends PaymentProcessor m_pp.DestroyContext(); // long ms = System.currentTimeMillis() - start; - log.fine("<- " + ms + "ms - " + rc + " - " + response); + if (log.isLoggable(Level.FINE)) log.fine("<- " + ms + "ms - " + rc + " - " + response); p_mp.setR_Result(""); p_mp.setR_Info(response); // complete info diff --git a/org.adempiere.payment.processor/src/org/compiere/model/PP_PayFlowPro4.java b/org.adempiere.payment.processor/src/org/compiere/model/PP_PayFlowPro4.java index e89be6ca43..5ad63bca2c 100644 --- a/org.adempiere.payment.processor/src/org/compiere/model/PP_PayFlowPro4.java +++ b/org.adempiere.payment.processor/src/org/compiere/model/PP_PayFlowPro4.java @@ -79,7 +79,7 @@ public final class PP_PayFlowPro4 extends PaymentProcessor */ public boolean processCC () throws IllegalArgumentException { - log.fine(p_mbap.getHostAddress() + " " + p_mbap.getHostPort() + ", Timeout=" + getTimeout() + if (log.isLoggable(Level.FINE)) log.fine(p_mbap.getHostAddress() + " " + p_mbap.getHostPort() + ", Timeout=" + getTimeout() + "; Proxy=" + p_mbap.getProxyAddress() + " " + p_mbap.getProxyPort() + " " + p_mbap.getProxyLogon() + " " + p_mbap.getProxyPassword()); if ( p_mbap.getC_Currency_ID() != 0 && p_mbap.getC_Currency_ID() != p_mp.getC_Currency_ID() ) diff --git a/org.adempiere.replication.server/src/org/compiere/server/ReplicationProcessor.java b/org.adempiere.replication.server/src/org/compiere/server/ReplicationProcessor.java index 4a1e3b5751..39be155dd3 100644 --- a/org.adempiere.replication.server/src/org/compiere/server/ReplicationProcessor.java +++ b/org.adempiere.replication.server/src/org/compiere/server/ReplicationProcessor.java @@ -29,6 +29,7 @@ package org.compiere.server; import java.sql.Timestamp; +import java.util.logging.Level; import org.adempiere.server.rpl.IImportProcessor; import org.compiere.model.AdempiereProcessor; @@ -102,13 +103,13 @@ public class ReplicationProcessor extends AdempiereServer { { // trxName = "ImportProcessor-" + System.currentTimeMillis(); } - log.fine("trxName = " + trxName); - log.fine("ImportProcessor = " + mImportProcessor); + if (log.isLoggable(Level.FINE)) log.fine("trxName = " + trxName); + if (log.isLoggable(Level.FINE)) log.fine("ImportProcessor = " + mImportProcessor); int IMP_ProcessorType_ID = 0; IMP_ProcessorType_ID = mImportProcessor.getIMP_Processor_Type_ID(); X_IMP_Processor_Type impProcessor_Type = new X_IMP_Processor_Type(mImportProcessor.getCtx(), IMP_ProcessorType_ID, trxName ); - log.fine("impProcessor_Type = " + impProcessor_Type); // TODO --- REMOVE + if (log.isLoggable(Level.FINE)) log.fine("impProcessor_Type = " + impProcessor_Type); // TODO --- REMOVE String javaClass = impProcessor_Type.getJavaClass(); IImportProcessor importProcessor = null; @@ -121,7 +122,7 @@ public class ReplicationProcessor extends AdempiereServer { catch (Exception e) { isProcessRunning = false; - log.fine("ReplicationProcessor caught an exception !!!" ); + if (log.isLoggable(Level.FINE)) log.fine("ReplicationProcessor caught an exception !!!" ); e.printStackTrace(); log.severe(e.getMessage()); MIMPProcessorLog pLog = new MIMPProcessorLog(mImportProcessor, e.getMessage() ); diff --git a/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ExportHelper.java b/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ExportHelper.java index bc8155fe34..eb76cd6e52 100644 --- a/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ExportHelper.java +++ b/org.adempiere.replication/src/org/adempiere/process/rpl/exp/ExportHelper.java @@ -129,7 +129,7 @@ public class ExportHelper { MEXPFormat exportFormat = null; //exportFormat = new MFormat(po.getCtx(), EXP_Format_ID, po.get_TrxName()); exportFormat = MEXPFormat.getFormatByAD_Client_IDAD_Table_IDAndVersion(po.getCtx(), m_AD_Client_ID, po.get_Table_ID(), version, po.get_TrxName()); - log.fine("exportFormat = " + exportFormat); + if (log.isLoggable(Level.FINE)) log.fine("exportFormat = " + exportFormat); if (exportFormat == null || exportFormat.getEXP_Format_ID() == 0) { // Fall back to System Client MClient systemClient = MClient.get (po.getCtx(), 0); @@ -160,7 +160,7 @@ public class ExportHelper { MEXPProcessor mExportProcessor = null; mExportProcessor = new MEXPProcessor (po.getCtx(), m_rplStrategy.getEXP_Processor_ID(), po.get_TrxName() ); - log.fine("ExportProcessor = " + mExportProcessor); + if (log.isLoggable(Level.FINE)) log.fine("ExportProcessor = " + mExportProcessor); int EXP_ProcessorType_ID = 0; EXP_ProcessorType_ID = mExportProcessor.getEXP_Processor_Type_ID(); MEXPProcessorType expProcessor_Type = new MEXPProcessorType(po.getCtx(), EXP_ProcessorType_ID, po.get_TrxName() ); diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerGroup.java b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerGroup.java index 17393879c5..798d505540 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerGroup.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerGroup.java @@ -16,6 +16,8 @@ *****************************************************************************/ package org.compiere.server; +import java.util.logging.Level; + import org.compiere.util.CLogger; /** @@ -79,12 +81,12 @@ public class AdempiereServerGroup extends ThreadGroup */ public void dump () { - log.fine(getName() + (isDestroyed() ? " (destroyed)" : "")); - log.fine("- Parent=" + getParent()); + if (log.isLoggable(Level.FINE)) log.fine(getName() + (isDestroyed() ? " (destroyed)" : "")); + if (log.isLoggable(Level.FINE)) log.fine("- Parent=" + getParent()); Thread[] list = new Thread[activeCount()]; - log.fine("- Count=" + enumerate(list, true)); + if (log.isLoggable(Level.FINE)) log.fine("- Count=" + enumerate(list, true)); for (int i = 0; i < list.length; i++) - log.fine("-- " + list[i]); + if (log.isLoggable(Level.FINE)) log.fine("-- " + list[i]); } // dump } // AdempiereServerGroup diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java index 40003792ef..8ac348dd16 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AdempiereServerMgr.java @@ -202,7 +202,7 @@ public class AdempiereServerMgr } } - log.fine("#" + noServers); + if (log.isLoggable(Level.FINE)) log.fine("#" + noServers); return startAll(); } // startEnvironment @@ -265,7 +265,7 @@ public class AdempiereServerMgr noStopped++; } } - log.fine("Running=" + noRunning + ", Stopped=" + noStopped); + if (log.isLoggable(Level.FINE)) log.fine("Running=" + noRunning + ", Stopped=" + noStopped); return noStopped == 0; } // startAll @@ -370,7 +370,7 @@ public class AdempiereServerMgr noRunning++; } } - log.fine("Running=" + noRunning + ", Stopped=" + noStopped); + if (log.isLoggable(Level.FINE)) log.fine("Running=" + noRunning + ", Stopped=" + noStopped); AdempiereServerGroup.get().dump(); return noRunning == 0; } // stopAll diff --git a/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java b/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java index f2c2810660..1ce38ada27 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/AlertProcessor.java @@ -140,7 +140,7 @@ public class AlertProcessor extends AdempiereServer MAlertRule rule = rules[i]; if (!rule.isValid()) continue; - log.fine("" + rule); + if (log.isLoggable(Level.FINE)) log.fine("" + rule); // Pre String sql = rule.getPreProcessing(); diff --git a/org.adempiere.server/src/main/server/org/compiere/server/EMailProcessor.java b/org.adempiere.server/src/main/server/org/compiere/server/EMailProcessor.java index ea70e7e0e8..f08cecf94f 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/EMailProcessor.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/EMailProcessor.java @@ -145,7 +145,7 @@ public class EMailProcessor // m_session = Session.getDefaultInstance(props, auth); m_session.setDebug(CLogMgt.isLevelFinest()); - log.fine("getSession - " + m_session); + if (log.isLoggable(Level.FINE)) log.fine("getSession - " + m_session); return m_session; } // getSession @@ -167,7 +167,7 @@ public class EMailProcessor // Connect m_store.connect(); // - log.fine("getStore - " + m_store); + if (log.isLoggable(Level.FINE)) log.fine("getStore - " + m_store); return m_store; } // getStore @@ -189,7 +189,7 @@ public class EMailProcessor if (!inbox.exists()) throw new IllegalStateException("No Inbox"); inbox.open(Folder.READ_WRITE); - log.fine("processInBox - " + inbox.getName() + if (log.isLoggable(Level.FINE)) log.fine("processInBox - " + inbox.getName() + "; Messages Total=" + inbox.getMessageCount() + "; New=" + inbox.getNewMessageCount()); diff --git a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java index bb19236f3a..2b8d1380ab 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java @@ -311,7 +311,7 @@ public class Scheduler extends AdempiereServer if (paraDesc != null && paraDesc.trim().length() > 0) iPara.setInfo(sPara.getDescription()); String variable = sPara.getParameterDefault(); - log.fine(sPara.getColumnName() + " = " + variable); + if (log.isLoggable(Level.FINE)) log.fine(sPara.getColumnName() + " = " + variable); // Value - Constant/Variable Object value = variable; if (variable == null @@ -349,7 +349,7 @@ public class Scheduler extends AdempiereServer // No Value if (value == null) { - log.fine(sPara.getColumnName() + " - empty"); + if (log.isLoggable(Level.FINE)) log.fine(sPara.getColumnName() + " - empty"); break; } @@ -367,7 +367,7 @@ public class Scheduler extends AdempiereServer else bd = new BigDecimal (value.toString()); iPara.setP_Number(bd); - log.fine(sPara.getColumnName() + if (log.isLoggable(Level.FINE)) log.fine(sPara.getColumnName() + " = " + variable + " (=" + bd + "=)"); } else if (DisplayType.isDate(sPara.getDisplayType())) @@ -378,13 +378,13 @@ public class Scheduler extends AdempiereServer else ts = Timestamp.valueOf(value.toString()); iPara.setP_Date(ts); - log.fine(sPara.getColumnName() + if (log.isLoggable(Level.FINE)) log.fine(sPara.getColumnName() + " = " + variable + " (=" + ts + "=)"); } else { iPara.setP_String(value.toString()); - log.fine(sPara.getColumnName() + if (log.isLoggable(Level.FINE)) log.fine(sPara.getColumnName() + " = " + variable + " (=" + value + "=) " + value.getClass().getName()); } diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java index 838c7a6fc5..e0d2787cdb 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java @@ -1300,7 +1300,7 @@ public final class APanel extends CPanel */ public void setStatusLine (String text, boolean error) { - log.fine(text); + if (log.isLoggable(Level.FINE)) log.fine(text); statusBar.setStatusLine(text, error); } // setStatusLine @@ -2033,7 +2033,7 @@ public final class APanel extends CPanel Object[] selectedValues = list.getSelectedValues(); for (int i = 0; i < selectedValues.length; i++) { - log.fine(selectedValues[i].toString()); + if (log.isLoggable(Level.FINE)) log.fine(selectedValues[i].toString()); } int[] indices = list.getSelectedIndices(); Arrays.sort(indices); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ClientProcessCtrl.java b/org.adempiere.ui.swing/src/org/compiere/apps/ClientProcessCtrl.java index 2f65b3560f..79e925a324 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ClientProcessCtrl.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ClientProcessCtrl.java @@ -1,6 +1,7 @@ package org.compiere.apps; import java.awt.Container; +import java.util.logging.Level; import org.adempiere.util.IProcessUI; import org.compiere.model.MPInstance; @@ -36,7 +37,7 @@ public class ClientProcessCtrl { */ public static ProcessCtl process (IProcessUI parent, int WindowNo, ProcessInfo pi, Trx trx) { - log.fine("WindowNo=" + WindowNo + " - " + pi); + if (log.isLoggable(Level.FINE)) log.fine("WindowNo=" + WindowNo + " - " + pi); MPInstance instance = null; try diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessCtl.java b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessCtl.java index 6f0a31ca93..e95b9fc83f 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessCtl.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessCtl.java @@ -67,7 +67,7 @@ public class ProcessCtl extends AbstractProcessCtl */ public static ProcessCtl process (IProcessUI parent, int WindowNo, ProcessInfo pi, Trx trx) { - log.fine("WindowNo=" + WindowNo + " - " + pi); + if (log.isLoggable(Level.FINE)) log.fine("WindowNo=" + WindowNo + " - " + pi); MPInstance instance = null; try @@ -145,7 +145,7 @@ public class ProcessCtl extends AbstractProcessCtl */ public static ProcessCtl process(IProcessUI parent, int WindowNo, IProcessParameter parameter, ProcessInfo pi, Trx trx) { - log.fine("WindowNo=" + WindowNo + " - " + pi); + if (log.isLoggable(Level.FINE)) log.fine("WindowNo=" + WindowNo + " - " + pi); MPInstance instance = null; try diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameter.java b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameter.java index e3391def1e..92ed7b02ef 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameter.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameter.java @@ -532,7 +532,7 @@ public class ProcessParameter extends CDialog para.setInfo_To (editor2.getDisplay()); // para.saveEx(); - log.fine(para.toString()); + if (log.isLoggable(Level.FINE)) log.fine(para.toString()); } // for every parameter return true; diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java index 07819d855a..4810a9aa25 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessParameterPanel.java @@ -409,7 +409,7 @@ public class ProcessParameterPanel extends CPanel implements VetoableChangeListe // if the lookup is dynamic (i.e. contains this columnName as variable) if (mLookup.getValidation().indexOf("@"+columnName+"@") != -1) { - log.fine(columnName + " changed - " + if (log.isLoggable(Level.FINE)) log.fine(columnName + " changed - " + field.getColumnName() + " set to null"); // invalidate current selection field.setValue(null, true); @@ -632,7 +632,7 @@ public class ProcessParameterPanel extends CPanel implements VetoableChangeListe para.setInfo_To (editor2.getDisplay()); // para.saveEx(); - log.fine(para.toString()); + if (log.isLoggable(Level.FINE)) log.fine(para.toString()); } // for every parameter return true; diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/Waiting.java b/org.adempiere.ui.swing/src/org/compiere/apps/Waiting.java index 1ce51e0834..6a6809878f 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/Waiting.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/Waiting.java @@ -86,7 +86,7 @@ public class Waiting extends CDialog */ private void init (String text, boolean canNotWait, int timer) { - log.fine(text + " - Sec=" + timer); + if (log.isLoggable(Level.FINE)) log.fine(text + " - Sec=" + timer); // don't show if 1 sec average if (timer == 1) return; diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VBOMDrop.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VBOMDrop.java index c33c010ba5..6724aaa8d0 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VBOMDrop.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/form/VBOMDrop.java @@ -335,7 +335,7 @@ public class VBOMDrop extends CPanel MPPProductBOMLine[] bomLines = bom.getLines(true); for (int i = 0; i < bomLines.length; i++) addBOMLine (bomLines[i], qty); - log.fine("#" + bomLines.length); + if (log.isLoggable(Level.FINE)) log.fine("#" + bomLines.length); } /** @@ -346,7 +346,7 @@ public class VBOMDrop extends CPanel */ private void addBOMLine (MPPProductBOMLine line, BigDecimal qty) { - log.fine(line.toString()); + if (log.isLoggable(Level.FINE)) log.fine(line.toString()); String bomType = line.getComponentType(); if (bomType == null) bomType = MPPProductBOMLine.COMPONENTTYPE_Component; @@ -374,7 +374,7 @@ public class VBOMDrop extends CPanel private void addDisplay (int parentM_Product_ID, int M_Product_ID, String bomType, String name, String feature , BigDecimal lineQty) { - log.fine("M_Product_ID=" + M_Product_ID + ",Type=" + bomType + ",Name=" + name + ",feature=" + feature + ",Qty=" + lineQty); + if (log.isLoggable(Level.FINE)) log.fine("M_Product_ID=" + M_Product_ID + ",Type=" + bomType + ",Name=" + name + ",feature=" + feature + ",Qty=" + lineQty); // boolean selected = true; if (MPPProductBOMLine.COMPONENTTYPE_Component.equals(bomType)) @@ -405,7 +405,7 @@ public class VBOMDrop extends CPanel ButtonGroup group = (ButtonGroup)m_buttonGroups.get(groupName); if (group == null) { - log.fine("ButtonGroup=" + groupName); + if (log.isLoggable(Level.FINE)) log.fine("ButtonGroup=" + groupName); group = new ButtonGroup(); m_buttonGroups.put(groupName, group); group.add(b); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java index 2f38ec9f86..75112740ed 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/form/VResetPassword.java @@ -234,13 +234,13 @@ public class VResetPassword implements FormPanel, ActionListener, VetoableChange String p_NewEMailUserPW = txtNewEMailUserPW.getText(); MUser user = MUser.get(Env.getCtx(), p_AD_User_ID); - log.fine("User=" + user); + if (log.isLoggable(Level.FINE)) log.fine("User=" + user); // Do we need a password ? if (Util.isEmpty(p_OldPassword)) // Password required { MUser operator = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx())); - log.fine("Operator=" + operator); + if (log.isLoggable(Level.FINE)) log.fine("Operator=" + operator); if (p_AD_User_ID == 0 // change of System || p_AD_User_ID == 100 // change of SuperUser diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java index ccdda3e7f8..fd6c6f257b 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java @@ -904,7 +904,7 @@ public final class Find extends CDialog */ private void parseUserQuery(MUserQuery userQuery) { String code = userQuery.getCode(); - log.fine("Parse user query: " + code); + if (log.isLoggable(Level.FINE)) log.fine("Parse user query: " + code); String[] segments = code.split(Pattern.quote(SEGMENT_SEPARATOR),-1); advancedTable.stopEditor(true); DefaultTableModel model = (DefaultTableModel)advancedTable.getModel(); @@ -1047,7 +1047,7 @@ public final class Find extends CDialog { String ColumnName = ((Component)ved).getName (); msglog = new StringBuilder().append(ColumnName).append("=").append(value); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); // globalqss - Carlos Ruiz - 20060711 // fix a bug with virtualColumn + isSelectionColumn not yielding results @@ -1389,7 +1389,7 @@ public final class Find extends CDialog ret.append(getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId)).append(","); } } - log.fine(ret.toString()); + if (log.isLoggable(Level.FINE)) log.fine(ret.toString()); StringBuilder msgreturn = new StringBuilder(ret.toString()).append(productCategoryId); return msgreturn.toString(); } diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/Info.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/Info.java index eb6396effc..a42425a8d8 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/Info.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/Info.java @@ -561,7 +561,7 @@ public abstract class Info extends CDialog DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + no + " - " + (System.currentTimeMillis()-start) + "ms"); + if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - " + (System.currentTimeMillis()-start) + "ms"); //Armen: add role checking (Patch #1694788 ) MRole role = MRole.getDefault(); if (role.isQueryMax(no)) @@ -1189,9 +1189,9 @@ public abstract class Info extends CDialog { m_pstmt = DB.prepareStatement(dataSql, null); setParameters (m_pstmt, false); // no count - log.fine("Start query - " + (System.currentTimeMillis()-start) + "ms"); + if (log.isLoggable(Level.FINE)) log.fine("Start query - " + (System.currentTimeMillis()-start) + "ms"); m_rs = m_pstmt.executeQuery(); - log.fine("End query - " + (System.currentTimeMillis()-start) + "ms"); + if (log.isLoggable(Level.FINE)) log.fine("End query - " + (System.currentTimeMillis()-start) + "ms"); while (m_rs.next()) { if (this.isInterrupted()) { @@ -1234,7 +1234,7 @@ public abstract class Info extends CDialog data = m_rs.getString(colIndex); // store p_table.setValueAt(data, row, col); - // log.fine( "r=" + row + ", c=" + col + " " + m_layout[col].getColHeader(), + // if (log.isLoggable(Level.FINE)) log.fine( "r=" + row + ", c=" + col + " " + m_layout[col].getColHeader(), // "data=" + data.toString() + " " + data.getClass().getName() + " * " + m_table.getCellRenderer(row, col)); } } @@ -1246,7 +1246,7 @@ public abstract class Info extends CDialog close(); // int no = p_table.getRowCount(); - log.fine("#" + no + " - " + (System.currentTimeMillis()-start) + "ms"); + if (log.isLoggable(Level.FINE)) log.fine("#" + no + " - " + (System.currentTimeMillis()-start) + "ms"); if(p_table.getShowTotals()) p_table.addTotals(p_layout); p_table.autoSize(); @@ -1255,7 +1255,7 @@ public abstract class Info extends CDialog setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); setStatusDB(Integer.toString(no)); if (no == 0) - log.fine(dataSql); + if (log.isLoggable(Level.FINE)) log.fine(dataSql); else { p_table.getSelectionModel().setSelectionInterval(0, 0); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAsset.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAsset.java index bfe7c6bf52..eb6a8fa6aa 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAsset.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoAsset.java @@ -20,6 +20,7 @@ import java.awt.Frame; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; +import java.util.logging.Level; import org.adempiere.plaf.AdempierePLAF; import org.compiere.apps.AEnv; @@ -238,7 +239,7 @@ public class InfoAsset extends Info if (!value.endsWith("%")) value += "%"; pstmt.setString(index++, value); - log.fine("Value: " + value); + if (log.isLoggable(Level.FINE)) log.fine("Value: " + value); } // => Name String name = fieldName.getText().toUpperCase(); @@ -247,7 +248,7 @@ public class InfoAsset extends Info if (!name.endsWith("%")) name += "%"; pstmt.setString(index++, name); - log.fine("Name: " + name); + if (log.isLoggable(Level.FINE)) log.fine("Name: " + name); } } // setParameters diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoBPartner.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoBPartner.java index e0f679127d..883e4ec07b 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoBPartner.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoBPartner.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.ArrayList; +import java.util.logging.Level; import org.adempiere.plaf.AdempierePLAF; import org.compiere.apps.AEnv; @@ -350,7 +351,7 @@ public class InfoBPartner extends Info if (!value.endsWith("%")) value += "%"; pstmt.setString(index++, value); - log.fine("Value: " + value); + if (log.isLoggable(Level.FINE)) log.fine("Value: " + value); } // => Name String name = fieldName.getText().toUpperCase(); @@ -359,7 +360,7 @@ public class InfoBPartner extends Info if (!name.endsWith("%")) name += "%"; pstmt.setString(index++, name); - log.fine("Name: " + name); + if (log.isLoggable(Level.FINE)) log.fine("Name: " + name); } // => Contact String contact = fieldContact.getText().toUpperCase(); @@ -368,7 +369,7 @@ public class InfoBPartner extends Info if (!contact.endsWith("%")) contact += "%"; pstmt.setString(index++, contact); - log.fine("Contact: " + contact); + if (log.isLoggable(Level.FINE)) log.fine("Contact: " + contact); } // => EMail String email = fieldEMail.getText().toUpperCase(); @@ -377,7 +378,7 @@ public class InfoBPartner extends Info if (!email.endsWith("%")) email += "%"; pstmt.setString(index++, email); - log.fine("EMail: " + email); + if (log.isLoggable(Level.FINE)) log.fine("EMail: " + email); } // => Phone String phone = fieldPhone.getText().toUpperCase(); @@ -386,7 +387,7 @@ public class InfoBPartner extends Info if (!phone.endsWith("%")) phone += "%"; pstmt.setString(index++, phone); - log.fine("Phone: " + phone); + if (log.isLoggable(Level.FINE)) log.fine("Phone: " + phone); } // => Postal String postal = fieldPostal.getText().toUpperCase(); @@ -395,7 +396,7 @@ public class InfoBPartner extends Info if (!postal.endsWith("%")) postal += "%"; pstmt.setString(index++, postal); - log.fine("Postal: " + postal); + if (log.isLoggable(Level.FINE)) log.fine("Postal: " + postal); } } // setParameters diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoCashLine.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoCashLine.java index 9be2986b74..f22cb97439 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoCashLine.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoCashLine.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; +import java.util.logging.Level; import org.adempiere.plaf.AdempierePLAF; import org.compiere.apps.ALayout; @@ -300,7 +301,7 @@ public class InfoCashLine extends Info sql.append(" AND cl.").append(MCashLine.COLUMNNAME_C_Charge_ID).append("=?"); } - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); return sql.toString(); } // getSQLWhere @@ -321,21 +322,21 @@ public class InfoCashLine extends Info { Integer cb = (Integer)fCashBook_ID.getValue(); pstmt.setInt(index++, cb.intValue()); - log.fine("CashBook=" + cb); + if (log.isLoggable(Level.FINE)) log.fine("CashBook=" + cb); } // if (fInvoice_ID.getValue() != null) { Integer i = (Integer)fInvoice_ID.getValue(); pstmt.setInt(index++, i.intValue()); - log.fine("Invoice=" + i); + if (log.isLoggable(Level.FINE)) log.fine("Invoice=" + i); } // if (fDateFrom.getValue() != null || fDateTo.getValue() != null) { Timestamp from = (Timestamp)fDateFrom.getValue(); Timestamp to = (Timestamp)fDateTo.getValue(); - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setTimestamp(index++, to); else if (from != null && to == null) @@ -358,7 +359,7 @@ public class InfoCashLine extends Info if (to != null) to = to.abs(); } - log.fine("Amt From=" + from + ", To=" + to + ", Absolute=" + cbAbsolute.isSelected()); + if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to + ", Absolute=" + cbAbsolute.isSelected()); if (from == null && to != null) pstmt.setBigDecimal(index++, to); else if (from != null && to == null) @@ -377,7 +378,7 @@ public class InfoCashLine extends Info if (fCharge_ID.getValue() != null) { Integer i = (Integer)fCharge_ID.getValue(); pstmt.setInt(index++, i.intValue()); - log.fine("Charge=" + i); + if (log.isLoggable(Level.FINE)) log.fine("Charge=" + i); } } // setParameters @@ -391,7 +392,7 @@ public class InfoCashLine extends Info String s = f.getText().toUpperCase(); if (!s.endsWith("%")) s += "%"; - log.fine( "String=" + s); + if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); return s; } // getSQLText } // InfoCashLine diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java index 44b7a54bab..3234446dcc 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java @@ -439,7 +439,7 @@ public class InfoGeneral extends Info String s = f.getText().toUpperCase(); if (!s.endsWith("%")) s += "%"; - log.fine( "String=" + s); + if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); return s; } // getSQLText diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInOut.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInOut.java index 8400e0c13b..ce9965462c 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInOut.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInOut.java @@ -20,6 +20,7 @@ import java.awt.Frame; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; +import java.util.logging.Level; import org.adempiere.plaf.AdempierePLAF; import org.compiere.apps.ALayout; @@ -284,14 +285,14 @@ public class InfoInOut extends Info { Integer bp = (Integer)fBPartner_ID.getValue(); pstmt.setInt(index++, bp.intValue()); - log.fine("BPartner=" + bp); + if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); } // if (fDateFrom.getValue() != null || fDateTo.getValue() != null) { Timestamp from = (Timestamp)fDateFrom.getValue(); Timestamp to = (Timestamp)fDateTo.getValue(); - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setTimestamp(index++, to); else if (from != null && to == null) @@ -315,7 +316,7 @@ public class InfoInOut extends Info String s = f.getText().toUpperCase(); if (!s.endsWith("%")) s += "%"; - log.fine( "String=" + s); + if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); return s; } // getSQLText diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInvoice.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInvoice.java index 64c153459b..84b563a2ac 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInvoice.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoInvoice.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; +import java.util.logging.Level; import org.adempiere.plaf.AdempierePLAF; import org.compiere.apps.ALayout; @@ -340,21 +341,21 @@ public class InfoInvoice extends Info { Integer bp = (Integer)fBPartner_ID.getValue(); pstmt.setInt(index++, bp.intValue()); - log.fine("BPartner=" + bp); + if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); } // if (fOrder_ID.getValue() != null) { Integer order = (Integer)fOrder_ID.getValue(); pstmt.setInt(index++, order.intValue()); - log.fine("Order=" + order); + if (log.isLoggable(Level.FINE)) log.fine("Order=" + order); } // if (fDateFrom.getValue() != null || fDateTo.getValue() != null) { Timestamp from = (Timestamp)fDateFrom.getValue(); Timestamp to = (Timestamp)fDateTo.getValue(); - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setTimestamp(index++, to); else if (from != null && to == null) @@ -370,7 +371,7 @@ public class InfoInvoice extends Info { BigDecimal from = (BigDecimal)fAmtFrom.getValue(); BigDecimal to = (BigDecimal)fAmtTo.getValue(); - log.fine("Amt From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setBigDecimal(index++, to); else if (from != null && to == null) @@ -395,7 +396,7 @@ public class InfoInvoice extends Info String s = f.getText().toUpperCase(); if (!s.endsWith("%")) s += "%"; - log.fine( "String=" + s); + if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); return s; } // getSQLText diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoOrder.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoOrder.java index c03dd1aebe..91b4e1a87a 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoOrder.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoOrder.java @@ -314,14 +314,14 @@ public class InfoOrder extends Info { Integer bp = (Integer)fBPartner_ID.getValue(); pstmt.setInt(index++, bp.intValue()); - log.fine("BPartner=" + bp); + if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); } // if (fDateFrom.getValue() != null || fDateTo.getValue() != null) { Timestamp from = (Timestamp)fDateFrom.getValue(); Timestamp to = (Timestamp)fDateTo.getValue(); - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setTimestamp(index++, to); else if (from != null && to == null) @@ -337,7 +337,7 @@ public class InfoOrder extends Info { BigDecimal from = (BigDecimal)fAmtFrom.getValue(); BigDecimal to = (BigDecimal)fAmtTo.getValue(); - log.fine("Amt From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setBigDecimal(index++, to); else if (from != null && to == null) @@ -361,7 +361,7 @@ public class InfoOrder extends Info String s = f.getText().toUpperCase(); if (!s.endsWith("%")) s += "%"; - log.fine("String=" + s); + if (log.isLoggable(Level.FINE)) log.fine("String=" + s); return s; } // getSQLText diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPayment.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPayment.java index d31fef26cd..86553081d7 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPayment.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoPayment.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; +import java.util.logging.Level; import org.adempiere.plaf.AdempierePLAF; import org.compiere.apps.ALayout; @@ -284,7 +285,7 @@ public class InfoPayment extends Info } sql.append(" AND p.IsReceipt=?"); - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); return sql.toString(); } // getSQLWhere @@ -305,14 +306,14 @@ public class InfoPayment extends Info { Integer bp = (Integer)fBPartner_ID.getValue(); pstmt.setInt(index++, bp.intValue()); - log.fine("BPartner=" + bp); + if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); } // if (fDateFrom.getValue() != null || fDateTo.getValue() != null) { Timestamp from = (Timestamp)fDateFrom.getValue(); Timestamp to = (Timestamp)fDateTo.getValue(); - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setTimestamp(index++, to); else if (from != null && to == null) @@ -328,7 +329,7 @@ public class InfoPayment extends Info { BigDecimal from = (BigDecimal)fAmtFrom.getValue(); BigDecimal to = (BigDecimal)fAmtTo.getValue(); - log.fine("Amt From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setBigDecimal(index++, to); else if (from != null && to == null) @@ -352,7 +353,7 @@ public class InfoPayment extends Info String s = f.getText().toUpperCase(); if (!s.endsWith("%")) s += "%"; - log.fine( "String=" + s); + if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); return s; } // getSQLText diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java index df3c69557e..a1bee735f3 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java @@ -829,7 +829,7 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener pstmt.setInt(index++, M_Warehouse_ID); } } - log.fine("M_Warehouse_ID=" + M_Warehouse_ID + " (" + (index-1) + "*)"); + if (log.isLoggable(Level.FINE)) log.fine("M_Warehouse_ID=" + M_Warehouse_ID + " (" + (index-1) + "*)"); // => PriceList int M_PriceList_Version_ID = 0; @@ -839,19 +839,19 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener if (M_PriceList_Version_ID != 0) { pstmt.setInt(index++, M_PriceList_Version_ID); - log.fine("M_PriceList_Version_ID=" + M_PriceList_Version_ID); + if (log.isLoggable(Level.FINE)) log.fine("M_PriceList_Version_ID=" + M_PriceList_Version_ID); } // => Product Category int M_Product_Category_ID = getM_Product_Category_ID(); if (M_Product_Category_ID > 0) { pstmt.setInt(index++, M_Product_Category_ID); - log.fine("M_Product_Category_ID=" + M_Product_Category_ID); + if (log.isLoggable(Level.FINE)) log.fine("M_Product_Category_ID=" + M_Product_Category_ID); } // => Attribute Set - @Trifon int M_AttributeSet_ID = getM_AttributeSet_ID(); if (M_AttributeSet_ID > 0) { pstmt.setInt(index++, M_AttributeSet_ID); - log.fine("M_AttributeSet_ID=" + M_AttributeSet_ID); + if (log.isLoggable(Level.FINE)) log.fine("M_AttributeSet_ID=" + M_AttributeSet_ID); } // Rest of Parameter in Query for Attribute Search if (m_pAttributeWhere != null) @@ -864,7 +864,7 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener if (!value.endsWith("%")) value += "%"; pstmt.setString(index++, value); - log.fine("Value: " + value); + if (log.isLoggable(Level.FINE)) log.fine("Value: " + value); } // => Name @@ -874,7 +874,7 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener if (!name.endsWith("%")) name += "%"; pstmt.setString(index++, name); - log.fine("Name: " + name); + if (log.isLoggable(Level.FINE)) log.fine("Name: " + name); } // => UPC @@ -884,7 +884,7 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener if (!upc.endsWith("%")) upc += "%"; pstmt.setString(index++, upc); - log.fine("UPC: " + upc); + if (log.isLoggable(Level.FINE)) log.fine("UPC: " + upc); } // => SKU @@ -894,7 +894,7 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener if (!sku.endsWith("%")) sku += "%"; pstmt.setString(index++, sku); - log.fine("SKU: " + sku); + if (log.isLoggable(Level.FINE)) log.fine("SKU: " + sku); } // => Vendor @@ -904,7 +904,7 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener if (!vendor.endsWith("%")) vendor += "%"; pstmt.setString(index++, vendor); - log.fine("Vendor: " + vendor); + if (log.isLoggable(Level.FINE)) log.fine("Vendor: " + vendor); } } // setParameters diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InvoiceHistory.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InvoiceHistory.java index 1cbe8e8dd2..4e0783c17d 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InvoiceHistory.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InvoiceHistory.java @@ -261,7 +261,7 @@ public class InvoiceHistory extends CDialog */ private Vector> fillTable (String sql, int parameter) { - log.fine(sql + "; Parameter=" + parameter); + if (log.isLoggable(Level.FINE)) log.fine(sql + "; Parameter=" + parameter); Vector> data = new Vector>(); PreparedStatement pstmt = null; ResultSet rs = null; @@ -306,7 +306,7 @@ public class InvoiceHistory extends CDialog DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + data.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + data.size()); return data; } // fillTable @@ -316,7 +316,7 @@ public class InvoiceHistory extends CDialog */ private void fillLabel (String sql, int parameter) { - log.fine(sql + "; Parameter=" + parameter); + if (log.isLoggable(Level.FINE)) log.fine(sql + "; Parameter=" + parameter); String retValue = DB.getSQLValueString(null, sql, parameter); if (retValue != null) label.setText(retValue); @@ -521,7 +521,7 @@ public class InvoiceHistory extends CDialog DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + data.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + data.size()); // Table m_modelUnconfirmed = new DefaultTableModel(data, columnNames); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/PAttributeInstance.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/PAttributeInstance.java index f1c35ac3d5..d1d77ee2e7 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/PAttributeInstance.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/PAttributeInstance.java @@ -351,7 +351,7 @@ public class PAttributeInstance extends CDialog } } confirmPanel.getOKButton().setEnabled(enabled); - log.fine("M_AttributeSetInstance_ID=" + m_M_AttributeSetInstance_ID + if (log.isLoggable(Level.FINE)) log.fine("M_AttributeSetInstance_ID=" + m_M_AttributeSetInstance_ID + " - " + m_M_AttributeSetInstanceName + "; M_Locator_ID=" + m_M_Locator_ID); } // enableButtons diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedulePanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedulePanel.java index 32d5c25200..3dec6b4dd6 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedulePanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/VSchedulePanel.java @@ -198,7 +198,7 @@ public class VSchedulePanel extends JComponent implements MouseListener public void setAssignmentSlots (MAssignmentSlot[] mass, int S_Resource_ID, Timestamp startDate, Timestamp endDate) { - log.fine("S_Resource_ID=" + S_Resource_ID); + if (log.isLoggable(Level.FINE)) log.fine("S_Resource_ID=" + S_Resource_ID); m_S_Resource_ID = S_Resource_ID; m_noDays = TimeUtil.getDaysBetween (startDate, endDate); m_startDate = startDate; diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java b/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java index f374712819..4088a5c67d 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java @@ -475,7 +475,7 @@ public class WFActivity extends CPanel selTable.autoSize(false); display(null); - log.fine("#" + selTable.getModel().getRowCount() + if (log.isLoggable(Level.FINE)) log.fine("#" + selTable.getModel().getRowCount() + "(" + (System.currentTimeMillis()-start) + "ms)"); return selTable.getModel().getRowCount(); } // loadActivities @@ -506,7 +506,7 @@ public class WFActivity extends CPanel */ public void display(IDColumn id) { - log.fine("ID=" + id); + if (log.isLoggable(Level.FINE)) log.fine("ID=" + id); m_activity = resetDisplay(id); // if (m_menu != null) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPanel.java index 43ca35bf28..2ae5d94245 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFPanel.java @@ -239,7 +239,7 @@ public class WFPanel extends CPanel m_WindowNo = WindowNo; m_frame = frame; // - log.fine("WindowNo=" + WindowNo); + if (log.isLoggable(Level.FINE)) log.fine("WindowNo=" + WindowNo); try { loadPanel(); @@ -310,7 +310,7 @@ public class WFPanel extends CPanel */ public void load (int AD_Workflow_ID, boolean readWrite) { - log.fine("RW=" + readWrite + " - AD_Workflow_ID=" + AD_Workflow_ID); + if (log.isLoggable(Level.FINE)) log.fine("RW=" + readWrite + " - AD_Workflow_ID=" + AD_Workflow_ID); if (AD_Workflow_ID == 0) return; int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); @@ -412,7 +412,7 @@ public class WFPanel extends CPanel */ public void start (MWFNode node) { - log.fine("Node=" + node); + if (log.isLoggable(Level.FINE)) log.fine("Node=" + node); // Info Text StringBuilder msg = new StringBuilder(""); msg.append("

").append(node.getName(true)).append("

"); diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/RecordAccessDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/RecordAccessDialog.java index 33e8e3d752..f3c48d964e 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/RecordAccessDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/RecordAccessDialog.java @@ -144,7 +144,7 @@ public class RecordAccessDialog extends CDialog rs = null; pstmt = null; } - log.fine("#" + m_recordAccesss.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_recordAccesss.size()); setLine(0, false); } // dynInit @@ -188,7 +188,7 @@ public class RecordAccessDialog extends CDialog */ private void setLine (int rowDelta, boolean newRecord) { - log.fine("delta=" + rowDelta + ", new=" + newRecord + if (log.isLoggable(Level.FINE)) log.fine("delta=" + rowDelta + ", new=" + newRecord + " - currentRow=" + m_currentRow + ", size=" + m_recordAccesss.size()); int maxIndex = 0; // nothing defined @@ -265,7 +265,7 @@ public class RecordAccessDialog extends CDialog { roleField.setSelectedItem(selection); m_currentData = ra; - log.fine("" + ra); + if (log.isLoggable(Level.FINE)) log.fine("" + ra); } else m_currentData = null; @@ -325,7 +325,7 @@ public class RecordAccessDialog extends CDialog m_currentData.setIsDependentEntities(isDependentEntities); boolean success = m_currentData.save(); // - log.fine("Success=" + success); + if (log.isLoggable(Level.FINE)) log.fine("Success=" + success); return success; } // cmd_save @@ -343,7 +343,7 @@ public class RecordAccessDialog extends CDialog success = m_currentData.delete(true); m_currentData = null; m_recordAccesss.remove(m_currentRow); - log.fine("Success=" + success); + if (log.isLoggable(Level.FINE)) log.fine("Success=" + success); } return success; } // cmd_delete diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java b/org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java index 981563afaa..9bad5a1b11 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java @@ -223,32 +223,32 @@ public class VSortTab extends CPanel implements APanelTab // Sort Column if (AD_ColumnSortOrder_ID == rs.getInt(2)) { - log.fine("Sort=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("Sort=" + rs.getString(1) + "." + rs.getString(3)); m_ColumnSortName = rs.getString(3); yesLabel.setText(rs.getString(4)); } // Optional YesNo else if (AD_ColumnSortYesNo_ID == rs.getInt(2)) { - log.fine("YesNo=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("YesNo=" + rs.getString(1) + "." + rs.getString(3)); m_ColumnYesNoName = rs.getString(3); } // Parent2 else if (rs.getString(5).equals("Y")) { - log.fine("Parent=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("Parent=" + rs.getString(1) + "." + rs.getString(3)); m_ParentColumnName = rs.getString(3); } // KeyColumn else if (rs.getString(6).equals("Y")) { - log.fine("Key=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("Key=" + rs.getString(1) + "." + rs.getString(3)); m_KeyColumnName = rs.getString(3); } // Identifier else if (rs.getString(7).equals("Y")) { - log.fine("Identifier=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("Identifier=" + rs.getString(1) + "." + rs.getString(3)); boolean isTranslated = trl && "Y".equals(rs.getString(8)); if (identifierSql.length() > 0) identifierSql.append(","); @@ -259,7 +259,7 @@ public class VSortTab extends CPanel implements APanelTab m_IdentifierTranslated = true; } else - log.fine("??NotUsed??=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("??NotUsed??=" + rs.getString(1) + "." + rs.getString(3)); } } catch (SQLException e) @@ -443,7 +443,7 @@ public class VSortTab extends CPanel implements APanelTab if(m_ParentColumnName != null) { ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, m_ParentColumnName); - log.fine(sql.toString() + " - ID=" + ID); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString() + " - ID=" + ID); } else { diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VTableExcelAdapter.java b/org.adempiere.ui.swing/src/org/compiere/grid/VTableExcelAdapter.java index e29795c220..09477bc5ea 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VTableExcelAdapter.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/VTableExcelAdapter.java @@ -109,7 +109,7 @@ public class VTableExcelAdapter { // Only GridTable model is supported if (!(table.getModel() instanceof GridTable)) { - if(CLogMgt.isLevelFine()) log.fine("Not supported - " + table.getModel()); + if (log.isLoggable(Level.FINE)) log.fine("Not supported - " + table.getModel()); return; } diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/ComboSelectionManager.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/ComboSelectionManager.java index 0abe8cebf8..224ae0c977 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/ComboSelectionManager.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/ComboSelectionManager.java @@ -16,6 +16,8 @@ *****************************************************************************/ package org.compiere.grid.ed; +import java.util.logging.Level; + import javax.swing.ComboBoxModel; import javax.swing.JComboBox; @@ -50,7 +52,7 @@ public class ComboSelectionManager implements JComboBox.KeySelectionManager */ public int selectionForKey (char key, ComboBoxModel model) { - log.fine("Key=" + key); + if (log.isLoggable(Level.FINE)) log.fine("Key=" + key); // //Object selectedItem = model.getSelectedItem(); diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/Editor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/Editor.java index b186eb0eba..c15e8dbe22 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/Editor.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/Editor.java @@ -200,7 +200,7 @@ public class Editor extends CDialog if (e.getActionCommand().equals(ConfirmPanel.A_OK)) { m_text = textArea.getText(); - log.fine("OK - length=" + m_text.length()); + if (log.isLoggable(Level.FINE)) log.fine("OK - length=" + m_text.length()); dispose(); } else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL)) diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocDate.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocDate.java index eeafd6d627..279ef458a6 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocDate.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocDate.java @@ -241,7 +241,7 @@ public final class MDocDate extends PlainDocument implements CaretListener else if (e.getDot() == m_mask.length()-1) // last newDot = e.getDot() - 1; // - log.fine("OnFixedChar=" + m_mask.charAt(e.getDot()) + if (log.isLoggable(Level.FINE)) log.fine("OnFixedChar=" + m_mask.charAt(e.getDot()) + ", newDot=" + newDot + ", last=" + m_lastDot); // m_lastDot = e.getDot(); diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocNumber.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocNumber.java index 44e930a3ba..b10d4444ac 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocNumber.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocNumber.java @@ -210,7 +210,7 @@ public final class MDocNumber extends PlainDocument } else { - log.fine("Input=" + c + " (" + (int)c + ")"); + if (log.isLoggable(Level.FINE)) log.fine("Input=" + c + " (" + (int)c + ")"); if (c == m_percentSign && offset > 0 ) { // don't convert integers to percent. 1% = 0? diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocString.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocString.java index 84ad270253..dcb30e01ac 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocString.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/MDocString.java @@ -206,7 +206,7 @@ public final class MDocString extends PlainDocument implements CaretListener // Conversion char c = string.charAt(0); char cmd = m_VFormat.charAt(offset); - log.fine( "char=" + c + ", cmd=" + cmd); + if (log.isLoggable(Level.FINE)) log.fine( "char=" + c + ", cmd=" + cmd); switch (cmd) { case 'c': // c any Letter or Digits or space diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccountDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccountDialog.java index 6a47efab4d..5b965b8b33 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccountDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VAccountDialog.java @@ -476,7 +476,7 @@ public final class VAccountDialog extends CDialog */ private void addLine (GridField field, VEditor editor, boolean mandatory) { - log.fine("Field=" + field); + if (log.isLoggable(Level.FINE)) log.fine("Field=" + field); JLabel label = VEditorFactory.getLabel(field); label.setLabelFor((Component)editor); editor.setReadWrite(true); @@ -517,7 +517,7 @@ public final class VAccountDialog extends CDialog */ private void loadInfo (int C_ValidCombination_ID, int C_AcctSchema_ID) { - log.fine("C_ValidCombination_ID=" + C_ValidCombination_ID); + if (log.isLoggable(Level.FINE)) log.fine("C_ValidCombination_ID=" + C_ValidCombination_ID); String sql = "SELECT * FROM C_ValidCombination WHERE C_ValidCombination_ID=? AND C_AcctSchema_ID=?"; PreparedStatement pstmt = null; ResultSet rs = null; @@ -923,7 +923,7 @@ public final class VAccountDialog extends CDialog * Check if already exists */ sql.append("AD_Client_ID=? AND C_AcctSchema_ID=?"); - log.fine("Check = " + sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine("Check = " + sql.toString()); int IDvalue = 0; String Alias = null; PreparedStatement pstmt = null; @@ -952,7 +952,7 @@ public final class VAccountDialog extends CDialog pstmt = null; } - log.fine("ID=" + IDvalue + ", Alias=" + Alias); + if (log.isLoggable(Level.FINE)) log.fine("ID=" + IDvalue + ", Alias=" + Alias); if (Alias == null) Alias = ""; diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBPartner.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBPartner.java index e64bf8d8d5..1d43268e25 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBPartner.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VBPartner.java @@ -421,7 +421,7 @@ public final class VBPartner extends CDialog implements ActionListener else m_partner.setC_Greeting_ID(0); if (m_partner.save()) - log.fine("C_BPartner_ID=" + m_partner.getC_BPartner_ID()); + if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_ID=" + m_partner.getC_BPartner_ID()); else ADialog.error(m_WindowNo, this, "BPartnerNotSaved"); @@ -434,7 +434,7 @@ public final class VBPartner extends CDialog implements ActionListener m_pLocation.setPhone2(fPhone2.getText()); m_pLocation.setFax(fFax.getText()); if (m_pLocation.save()) - log.fine("C_BPartner_Location_ID=" + m_pLocation.getC_BPartner_Location_ID()); + if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_Location_ID=" + m_pLocation.getC_BPartner_Location_ID()); else ADialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "C_BPartner_Location_ID")); @@ -460,7 +460,7 @@ public final class VBPartner extends CDialog implements ActionListener m_user.setPhone2(fPhone2.getText()); m_user.setFax(fFax.getText()); if (m_user.save()) - log.fine("AD_User_ID=" + m_user.getAD_User_ID()); + if (log.isLoggable(Level.FINE)) log.fine("AD_User_ID=" + m_user.getAD_User_ID()); else ADialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "AD_User_ID")); } diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellEditor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellEditor.java index 11e6b92a70..1899ffcf59 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellEditor.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellEditor.java @@ -107,7 +107,7 @@ public final class VCellEditor extends AbstractCellEditor { if (!m_mField.isEditable (true)) // row data is in context return false; - log.fine(m_mField.getHeader()); // event may be null if CellEdit + if (log.isLoggable(Level.FINE)) log.fine(m_mField.getHeader()); // event may be null if CellEdit // not enough mouse clicks if (anEvent instanceof MouseEvent && ((MouseEvent)anEvent).getClickCount() < CLICK_TO_START) @@ -204,7 +204,7 @@ public final class VCellEditor extends AbstractCellEditor { if (m_table == null) return; - log.fine(e.getPropertyName() + "=" + e.getNewValue()); + if (log.isLoggable(Level.FINE)) log.fine(e.getPropertyName() + "=" + e.getNewValue()); // ((GridTable)m_table.getModel()).setChanged(true); } // vetoableChange diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java index 5ec9d7135f..579fbdfc3a 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VColor.java @@ -192,7 +192,7 @@ public class VColor extends CButton private CompiereColor getAdempiereColor() { Integer AD_Color_ID = (Integer)m_mTab.getValue("AD_Color_ID"); - log.fine("AD_Color_ID=" + AD_Color_ID); + if (log.isLoggable(Level.FINE)) log.fine("AD_Color_ID=" + AD_Color_ID); CompiereColor cc = null; // Color Type @@ -236,7 +236,7 @@ public class VColor extends CButton else return null; - log.fine("AdempiereColor=" + cc); + if (log.isLoggable(Level.FINE)) log.fine("AdempiereColor=" + cc); return cc; } // getAdempiereColor diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java index fc43480770..583ed6a446 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDate.java @@ -395,7 +395,7 @@ public class VDate extends JComponent } catch (ParseException pe) { - log.fine(pe.getMessage()); + if (log.isLoggable(Level.FINE)) log.fine(pe.getMessage()); } return ts; } // getValue diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDocAction.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDocAction.java index 6f2a4da790..7e299fe7f9 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDocAction.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VDocAction.java @@ -203,7 +203,7 @@ public class VDocAction extends CDialog return; } - log.fine("DocStatus=" + DocStatus + if (log.isLoggable(Level.FINE)) log.fine("DocStatus=" + DocStatus + ", DocAction=" + DocAction + ", OrderType=" + OrderType + ", IsSOTrx=" + IsSOTrx + ", Processing=" + Processing + ", AD_Table_ID=" + m_AD_Table_ID + ", Record_ID=" + Record_ID); @@ -245,7 +245,7 @@ public class VDocAction extends CDialog if(doctypeId==null || doctypeId.intValue()==0){ doctypeId = (Integer)m_mTab.getValue("C_DocTypeTarget_ID"); } - log.fine("get doctype: " + doctypeId); + if (log.isLoggable(Level.FINE)) log.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.swing/src/org/compiere/grid/ed/VImage.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImage.java index aabd65e42e..e3fe8e813c 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImage.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VImage.java @@ -22,6 +22,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyVetoException; +import java.util.logging.Level; import javax.swing.ImageIcon; import javax.swing.JButton; @@ -102,7 +103,7 @@ public class VImage extends JButton if (m_mImage == null || newValue != m_mImage.get_ID()) m_mImage = MImage.get (Env.getCtx(), newValue); // - log.fine(m_mImage.toString()); + if (log.isLoggable(Level.FINE)) log.fine(m_mImage.toString()); super.setText(null); if (m_mImage.getImage()==null) diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java index 1f359a365d..0e9ff2c0c4 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocationDialog.java @@ -262,7 +262,7 @@ public class VLocationDialog extends CDialog private void initLocation() { MCountry country = m_location.getCountry(); - log.fine(country.getName() + ", Region=" + country.isHasRegion() + " " + country.getCaptureSequence() + if (log.isLoggable(Level.FINE)) log.fine(country.getName() + ", Region=" + country.isHasRegion() + " " + country.getCaptureSequence() + ", C_Location_ID=" + m_location.getC_Location_ID()); // new Country if (country.getC_Country_ID() != s_oldCountry_ID) @@ -679,7 +679,7 @@ public class VLocationDialog extends CDialog // remove any spaces from the postcode and convert to upper case postcode = postcode.replaceAll(" ", "").toUpperCase(); - log.fine("Looking up postcode: " + postcode); + if (log.isLoggable(Level.FINE)) log.fine("Looking up postcode: " + postcode); // Lookup postcode on server. pcLookup.setServerUrl(country.getLookupUrl()); @@ -773,7 +773,7 @@ public class VLocationDialog extends CDialog { // found Region fRegion.setSelectedItem(regions[i]); - log.fine("Found region: " + regions[i].getName()); + if (log.isLoggable(Level.FINE)) log.fine("Found region: " + regions[i].getName()); found = true; } } @@ -783,7 +783,7 @@ public class VLocationDialog extends CDialog MRegion region = new MRegion(country, values.getRegion()); if (region.save()) { - log.fine("Added new region from web service: " + values.getRegion()); + if (log.isLoggable(Level.FINE)) log.fine("Added new region from web service: " + values.getRegion()); //reload regions to combo box fRegion = new CComboBoxEditable(MRegion.getRegions(Env.getCtx(), country.getC_Country_ID())); // select region diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocatorDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocatorDialog.java index d0e6a253e0..a624a08461 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocatorDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLocatorDialog.java @@ -246,11 +246,11 @@ public class VLocatorDialog extends CDialog rs = null; pstmt = null; } - log.fine("Warehouses=" + fWarehouse.getItemCount()); + if (log.isLoggable(Level.FINE)) log.fine("Warehouses=" + fWarehouse.getItemCount()); // Load existing Locators m_mLocator.fillComboBox(m_mandatory, true, true, false, false); // IDEMPIERE 90 - log.fine(m_mLocator.toString()); + if (log.isLoggable(Level.FINE)) log.fine(m_mLocator.toString()); fLocator.setModel(m_mLocator); fLocator.setValue(m_M_Locator_ID); fLocator.addActionListener(this); diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java index a69f6a6589..2bc6171696 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java @@ -596,7 +596,7 @@ public class VLookup extends JComponent */ public void setValue (Object value) { - log.fine(m_columnName + "=" + value); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + "=" + value); m_settingValue = true; // disable actions m_value = value; @@ -652,7 +652,7 @@ public class VLookup extends JComponent { m_value = null; actionCombo (null); // data binding - log.fine(m_columnName + "=" + value + ": Not found"); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + "=" + value + ": Not found"); } // we have lookup else if (m_combo.getSelectedItem() == null) @@ -660,7 +660,7 @@ public class VLookup extends JComponent NamePair pp = m_lookup.get(value); if (pp != null) { - log.fine(m_columnName + " added to combo - " + pp); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " added to combo - " + pp); // Add to Combo m_combo.addItem (pp); m_combo.setValue (value); @@ -837,7 +837,7 @@ public class VLookup extends JComponent */ private void actionCombo (Object value) { - log.fine("Value=" + value); + if (log.isLoggable(Level.FINE)) log.fine("Value=" + value); try { // -> GridController.vetoableChange @@ -864,7 +864,7 @@ public class VLookup extends JComponent if (!updated) { // happens if VLookup is used outside of APanel/GridController (no property listener) - log.fine(m_columnName + " - Value explicitly set - new=" + updatedValue + ", old=" + m_value); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Value explicitly set - new=" + updatedValue + ", old=" + m_value); // phib: the following check causes the update to fail on jre > 1.6.0_13 // commenting out as it does not appear to be necessary @@ -901,7 +901,7 @@ public class VLookup extends JComponent // Zoom / Validation String whereClause = getWhereClause(); // - log.fine(m_lookup.getColumnName() + if (log.isLoggable(Level.FINE)) log.fine(m_lookup.getColumnName() + ", Zoom=" + m_lookup.getZoom() + " (" + whereClause + ")"); // @@ -980,7 +980,7 @@ public class VLookup extends JComponent log.severe(m_columnName + " - Cannot Parse=" + whereClause); else { - log.fine(m_columnName + " - Parsed: " + validated); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Parsed: " + validated); return validated; } } @@ -1104,14 +1104,14 @@ public class VLookup extends JComponent if (id <= 0) { if (id == -3) - log.fine(m_columnName + " - Not Found - " + finalSQL); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Not Found - " + finalSQL); else - log.fine(m_columnName + " - Not Unique - " + finalSQL); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Not Unique - " + finalSQL); m_value = null; // force re-display actionButton(m_text.getText()); return; } - log.fine(m_columnName + " - Unique ID=" + id); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Unique ID=" + id); m_value = null; // forces re-display if value is unchanged but text updated and still unique resetTabInfo(); actionCombo (new Integer(id)); // data binding @@ -1617,7 +1617,7 @@ public class VLookup extends JComponent // original model may not have item if (!m_combo.getSelectedItem().equals(obj)) { - log.fine(m_columnName + " - added to combo - " + obj); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - added to combo - " + obj); m_combo.addItem(obj); m_combo.setSelectedItem(obj); } diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java index 58c8bd5aa4..f07df934a4 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttribute.java @@ -314,7 +314,7 @@ public class VPAttribute extends JComponent if (value.equals(m_value)) return; // new value - log.fine("Value=" + value); + if (log.isLoggable(Level.FINE)) log.fine("Value=" + value); m_value = value; m_text.setText(m_mPAttribute.getDisplay(value)); // loads value } // setValue diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java index b727107eb1..f3599fd668 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPAttributeDialog.java @@ -278,7 +278,7 @@ public class VPAttributeDialog extends CDialog if (m_productWindow) { MAttribute[] attributes = as.getMAttributes (false); - log.fine ("Product Attributes=" + attributes.length); + if (log.isLoggable(Level.FINE)) log.fine ("Product Attributes=" + attributes.length); for (int i = 0; i < attributes.length; i++) addAttributeLine (attributes[i], true, !m_productWindow); } @@ -296,7 +296,7 @@ public class VPAttributeDialog extends CDialog centerPanel.add(bSelect, null); // All Attributes MAttribute[] attributes = as.getMAttributes (true); - log.fine ("Instance Attributes=" + attributes.length); + if (log.isLoggable(Level.FINE)) log.fine ("Instance Attributes=" + attributes.length); for (int i = 0; i < attributes.length; i++) addAttributeLine (attributes[i], false, false); } @@ -424,7 +424,7 @@ public class VPAttributeDialog extends CDialog */ private void addAttributeLine (MAttribute attribute, boolean product, boolean readOnly) { - log.fine(attribute + ", Product=" + product + ", R/O=" + readOnly); + if (log.isLoggable(Level.FINE)) log.fine(attribute + ", Product=" + product + ", R/O=" + readOnly); CLabel label = new CLabel (attribute.getName()); if (product) label.setFont(new Font(label.getFont().getFontName(), Font.BOLD, label.getFont().getSize())); @@ -450,12 +450,12 @@ public class VPAttributeDialog extends CDialog } } if (found) - log.fine("Attribute=" + attribute.getName() + " #" + values.length + " - found: " + instance); + if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " - found: " + instance); else log.warning("Attribute=" + attribute.getName() + " #" + values.length + " - NOT found: " + instance); } // setComboBox else - log.fine("Attribute=" + attribute.getName() + " #" + values.length + " no instance"); + if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " no instance"); label.setLabelFor(editor); centerPanel.add(editor, null); if (readOnly) @@ -715,7 +715,7 @@ public class VPAttributeDialog extends CDialog String mandatory = ""; if (!m_productWindow && as.isLot()) { - log.fine("Lot=" + fieldLotString.getText ()); + if (log.isLoggable(Level.FINE)) log.fine("Lot=" + fieldLotString.getText ()); String text = fieldLotString.getText(); m_masi.setLot (text); if (as.isLotMandatory() && (text == null || text.length() == 0)) @@ -724,7 +724,7 @@ public class VPAttributeDialog extends CDialog } // Lot if (!m_productWindow && as.isSerNo()) { - log.fine("SerNo=" + fieldSerNo.getText()); + if (log.isLoggable(Level.FINE)) log.fine("SerNo=" + fieldSerNo.getText()); String text = fieldSerNo.getText(); m_masi.setSerNo(text); if (as.isSerNoMandatory() && (text == null || text.length() == 0)) @@ -733,7 +733,7 @@ public class VPAttributeDialog extends CDialog } // SerNo if (!m_productWindow && as.isGuaranteeDate()) { - log.fine("GuaranteeDate=" + fieldGuaranteeDate.getValue()); + if (log.isLoggable(Level.FINE)) log.fine("GuaranteeDate=" + fieldGuaranteeDate.getValue()); Timestamp ts = (Timestamp)fieldGuaranteeDate.getValue(); m_masi.setGuaranteeDate(ts); if (as.isGuaranteeDateMandatory() && ts == null) @@ -758,7 +758,7 @@ public class VPAttributeDialog extends CDialog { CComboBox editor = (CComboBox)m_editors.get(i); MAttributeValue value = (MAttributeValue)editor.getSelectedItem(); - log.fine(attributes[i].getName() + "=" + value); + if (log.isLoggable(Level.FINE)) log.fine(attributes[i].getName() + "=" + value); if (attributes[i].isMandatory() && value == null) mandatory += " - " + attributes[i].getName(); attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value); @@ -767,7 +767,7 @@ public class VPAttributeDialog extends CDialog { VNumber editor = (VNumber)m_editors.get(i); BigDecimal value = (BigDecimal)editor.getValue(); - log.fine(attributes[i].getName() + "=" + value); + if (log.isLoggable(Level.FINE)) log.fine(attributes[i].getName() + "=" + value); if (attributes[i].isMandatory() && value == null) mandatory += " - " + attributes[i].getName(); attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value); @@ -776,7 +776,7 @@ public class VPAttributeDialog extends CDialog { VString editor = (VString)m_editors.get(i); String value = editor.getText(); - log.fine(attributes[i].getName() + "=" + value); + if (log.isLoggable(Level.FINE)) log.fine(attributes[i].getName() + "=" + value); if (attributes[i].isMandatory() && (value == null || value.length() == 0)) mandatory += " - " + attributes[i].getName(); attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value); diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java index a1c2a06cbe..00b50fc2b4 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VPaymentEditor.java @@ -235,7 +235,7 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene @Override public void setValue(Object value) { - log.fine(m_columnName + "=" + value); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + "=" + value); m_settingValue = true; // disable actions m_value = value; @@ -284,7 +284,7 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene { m_value = null; actionCombo (null); // data binding - log.fine(m_columnName + "=" + value + ": Not found"); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + "=" + value + ": Not found"); } // we have lookup else if (m_combo.getSelectedItem() == null) @@ -292,7 +292,7 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene NamePair pp = m_lookup.get(value); if (pp != null) { - log.fine(m_columnName + " added to combo - " + pp); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " added to combo - " + pp); // Add to Combo m_combo.addItem (pp); m_combo.setValue (value); @@ -381,7 +381,7 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene private void actionCombo (Object value) { - log.fine("Value=" + value); + if (log.isLoggable(Level.FINE)) log.fine("Value=" + value); try { // -> GridController.vetoableChange @@ -408,7 +408,7 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene if (!updated) { // happens if VLookup is used outside of APanel/GridController (no property listener) - log.fine(m_columnName + " - Value explicitly set - new=" + updatedValue + ", old=" + m_value); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - Value explicitly set - new=" + updatedValue + ", old=" + m_value); // phib: the following check causes the update to fail on jre > 1.6.0_13 // commenting out as it does not appear to be necessary @@ -520,7 +520,7 @@ public class VPaymentEditor extends JComponent implements VEditor, ActionListene // original model may not have item if (!m_combo.getSelectedItem().equals(obj)) { - log.fine(m_columnName + " - added to combo - " + obj); + if (log.isLoggable(Level.FINE)) log.fine(m_columnName + " - added to combo - " + obj); m_combo.addItem(obj); m_combo.setSelectedItem(obj); } diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDEditor.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDEditor.java index 24765be9a6..8846ba3cde 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDEditor.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VRowIDEditor.java @@ -19,6 +19,7 @@ package org.compiere.grid.ed; import java.awt.Component; import java.awt.Insets; import java.util.EventObject; +import java.util.logging.Level; import javax.swing.AbstractCellEditor; import javax.swing.JCheckBox; @@ -88,7 +89,7 @@ public class VRowIDEditor extends AbstractCellEditor implements TableCellEditor public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int col) { - log.fine("Value=" + value + ", row=" + row + ", col=" + col); + if (log.isLoggable(Level.FINE)) log.fine("Value=" + value + ", row=" + row + ", col=" + col); m_rid = (Object[])value; if (m_rid == null || m_rid[1] == null) m_cb.setSelected(false); @@ -113,7 +114,7 @@ public class VRowIDEditor extends AbstractCellEditor implements TableCellEditor */ public Object getCellEditorValue() { - log.fine("" + m_cb.isSelected()); + if (log.isLoggable(Level.FINE)) log.fine("" + m_cb.isSelected()); if (m_rid == null) return null; m_rid[1] = new Boolean (m_cb.isSelected()); diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/ValuePreference.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/ValuePreference.java index fe5764a959..12c51e925a 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/ValuePreference.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/ValuePreference.java @@ -445,7 +445,7 @@ public class ValuePreference extends CDialog sql.append(" AND AD_Window_ID IS NULL"); sql.append(" AND Attribute='").append(m_Attribute).append("'"); // - log.fine( sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine( sql.toString()); int no = DB.executeUpdate(sql.toString(), null); if (no > 0) Env.setContext(m_ctx, getContextKey(), (String)null); @@ -509,7 +509,7 @@ public class ValuePreference extends CDialog // sql.append(DB.TO_STRING(m_Attribute)).append(",").append(DB.TO_STRING(m_Value)).append(")"); // - log.fine( sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine( sql.toString()); no = DB.executeUpdate(sql.toString(), null); if (no == 1) { diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/tree/AdempiereTreeModel.java b/org.adempiere.ui.swing/src/org/compiere/grid/tree/AdempiereTreeModel.java index 9defc48ce1..ce26793f5e 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/tree/AdempiereTreeModel.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/tree/AdempiereTreeModel.java @@ -88,7 +88,7 @@ public class AdempiereTreeModel extends DefaultTreeModel { .append(", Updated=SysDate") .append(" WHERE AD_Tree_ID=").append(AD_Tree_ID) .append(" AND Node_ID=").append(nd.getNode_ID()); - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); no = DB.executeUpdate(sql.toString(),trx.getTrxName()); } trx.commit(true); diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java b/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java index 14809ca0ad..ad420c07d7 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java @@ -832,7 +832,7 @@ public final class VTreePanel extends CPanel while (enTop.hasMoreElements()) { MTreeNode ndTop = (MTreeNode)enTop.nextElement(); if(ndTop.getNode_ID()==topParentId){ - log.fine("add new category: " + ndTop); + if (log.isLoggable(Level.FINE)) log.fine("add new category: " + ndTop); parent = new JToolBar(JToolBar.VERTICAL); toolbarMap.put(ndTop.getNode_ID(), parent); @@ -857,7 +857,7 @@ public final class VTreePanel extends CPanel } } } else { - log.fine("parent found: " + parent); + if (log.isLoggable(Level.FINE)) log.fine("parent found: " + parent); } return parent; } diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyPanel.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyPanel.java index 87b4d35ed1..7103a28fbf 100644 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyPanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyPanel.java @@ -21,6 +21,7 @@ import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.HashMap; +import java.util.logging.Level; import javax.swing.Icon; import javax.swing.SwingConstants; @@ -124,7 +125,7 @@ public class PosKeyPanel extends CPanel implements ActionListener { int buttons = 0; - log.fine( "PosSubFunctionKeys.init - NoKeys=" + noKeys + if (log.isLoggable(Level.FINE)) log.fine( "PosSubFunctionKeys.init - NoKeys=" + noKeys + ", Cols=" + cols); // Content CPanel content = new CPanel (new MigLayout("fill, wrap " + Math.max(cols, 3))); @@ -157,7 +158,7 @@ public class PosKeyPanel extends CPanel implements ActionListener { buttonHTML.append(key.getName()); buttonHTML.append("

"); - log.fine( "#" + map.size() + " - " + keyColor); + if (log.isLoggable(Level.FINE)) log.fine( "#" + map.size() + " - " + keyColor); CButton button = new CButton(buttonHTML.toString()); button.setBackground(keyColor); button.setFont(keyFont); diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyboardFocusManager.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyboardFocusManager.java index 1f0a31b6f9..4b47a65d5c 100644 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyboardFocusManager.java +++ b/org.adempiere.ui.swing/src/org/compiere/pos/PosKeyboardFocusManager.java @@ -19,6 +19,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.util.LinkedList; +import java.util.logging.Level; import org.compiere.util.CLogger; @@ -74,7 +75,7 @@ public class PosKeyboardFocusManager extends DefaultKeyboardFocusManager public void start() { // Unqueue time - 200 ms int delay = 200; - log.fine("PosKeyboardFocusManager.start - " + delay); + if (log.isLoggable(Level.FINE)) log.fine("PosKeyboardFocusManager.start - " + delay); if (m_timer == null) m_timer = new javax.swing.Timer(delay, this); if (!m_timer.isRunning()) @@ -85,7 +86,7 @@ public class PosKeyboardFocusManager extends DefaultKeyboardFocusManager * Stop Timer */ public void stop() { - log.fine("PosKeyboardFocusManager.stop - " + m_timer); + if (log.isLoggable(Level.FINE)) log.fine("PosKeyboardFocusManager.stop - " + m_timer); if (m_timer != null) m_timer.stop(); diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java b/org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java index 6b23add169..f9bbc941fd 100644 --- a/org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java +++ b/org.adempiere.ui.swing/src/org/compiere/pos/PosOrderModel.java @@ -16,6 +16,7 @@ package org.compiere.pos; import java.math.BigDecimal; import java.util.HashMap; import java.util.Properties; +import java.util.logging.Level; import org.compiere.model.MBPartner; import org.compiere.model.MBankAccountProcessor; @@ -419,7 +420,7 @@ public class PosOrderModel extends MOrder { // ValueNamePair[] retValue = new ValueNamePair[map.size ()]; map.values ().toArray (retValue); - log.fine("getCreditCards - #" + retValue.length + " - Processors=" + m_mBankAccountProcessors.length); + if (log.isLoggable(Level.FINE)) log.fine("getCreditCards - #" + retValue.length + " - Processors=" + m_mBankAccountProcessors.length); return retValue; } catch (Exception ex) diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/QueryBPartner.java b/org.adempiere.ui.swing/src/org/compiere/pos/QueryBPartner.java index 31e4b38da0..605d89f4bf 100644 --- a/org.adempiere.ui.swing/src/org/compiere/pos/QueryBPartner.java +++ b/org.adempiere.ui.swing/src/org/compiere/pos/QueryBPartner.java @@ -17,6 +17,7 @@ package org.compiere.pos; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; +import java.util.logging.Level; import javax.swing.KeyStroke; import javax.swing.border.TitledBorder; @@ -260,7 +261,7 @@ public class QueryBPartner extends PosQuery } } f_ok.setEnabled(enabled); - log.fine("C_BPartner_ID=" + m_C_BPartner_ID); + if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_ID=" + m_C_BPartner_ID); } // enableButtons /** @@ -269,7 +270,7 @@ public class QueryBPartner extends PosQuery */ protected void close() { - log.fine("C_BPartner_ID=" + m_C_BPartner_ID); + if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_ID=" + m_C_BPartner_ID); if (m_C_BPartner_ID > 0) { diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/QueryProduct.java b/org.adempiere.ui.swing/src/org/compiere/pos/QueryProduct.java index 50aaf2deb2..673b8f7ab3 100644 --- a/org.adempiere.ui.swing/src/org/compiere/pos/QueryProduct.java +++ b/org.adempiere.ui.swing/src/org/compiere/pos/QueryProduct.java @@ -18,6 +18,7 @@ import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.math.BigDecimal; +import java.util.logging.Level; import javax.swing.KeyStroke; import javax.swing.border.TitledBorder; @@ -275,7 +276,7 @@ public class QueryProduct extends PosQuery } } f_ok.setEnabled(enabled); - log.fine("M_Product_ID=" + m_M_Product_ID + " - " + m_ProductName + " - " + m_Price); + if (log.isLoggable(Level.FINE)) log.fine("M_Product_ID=" + m_M_Product_ID + " - " + m_ProductName + " - " + m_Price); } // enableButtons @@ -286,7 +287,7 @@ public class QueryProduct extends PosQuery */ protected void close() { - log.fine("M_Product_ID=" + m_M_Product_ID); + if (log.isLoggable(Level.FINE)) log.fine("M_Product_ID=" + m_M_Product_ID); if (m_M_Product_ID > 0) { diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java b/org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java index a9df8564ab..77e2333e7c 100644 --- a/org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java +++ b/org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java @@ -633,7 +633,7 @@ public class SubCurrentLine extends PosSubPanel implements ActionListener, Focus */ public void setM_Product_ID (int M_Product_ID) { - log.fine( "PosSubProduct.setM_Product_ID=" + M_Product_ID); + if (log.isLoggable(Level.FINE)) log.fine( "PosSubProduct.setM_Product_ID=" + M_Product_ID); if (M_Product_ID <= 0) m_product = null; else @@ -706,7 +706,7 @@ public class SubCurrentLine extends PosSubPanel implements ActionListener, Focus if ( lineId <= 0 ) return; - log.fine("SubCurrentLine - loading line " + lineId); + if (log.isLoggable(Level.FINE)) log.fine("SubCurrentLine - loading line " + lineId); MOrderLine ol = new MOrderLine(p_ctx, lineId, null); if ( ol != null ) { diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/SubOrder.java b/org.adempiere.ui.swing/src/org/compiere/pos/SubOrder.java index 093e423a92..175001b3f2 100644 --- a/org.adempiere.ui.swing/src/org/compiere/pos/SubOrder.java +++ b/org.adempiere.ui.swing/src/org/compiere/pos/SubOrder.java @@ -25,6 +25,7 @@ import java.awt.event.KeyEvent; import java.io.FileOutputStream; import java.io.IOException; import java.util.Vector; +import java.util.logging.Level; import javax.swing.DefaultComboBoxModel; import javax.swing.JFormattedTextField; @@ -408,7 +409,7 @@ public class SubOrder extends PosSubPanel */ public void setC_BPartner_ID (int C_BPartner_ID) { - log.fine( "PosSubCustomer.setC_BPartner_ID=" + C_BPartner_ID); + if (log.isLoggable(Level.FINE)) log.fine( "PosSubCustomer.setC_BPartner_ID=" + C_BPartner_ID); if (C_BPartner_ID == 0) m_bpartner = null; else diff --git a/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTable.java b/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTable.java index fd93b8c255..88948d77a2 100644 --- a/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTable.java +++ b/org.adempiere.ui.swing/src/org/compiere/report/core/ResultTable.java @@ -142,7 +142,7 @@ public class ResultTable extends JTable implements MouseListener public void tableChanged(TableModelEvent e) { super.tableChanged(e); - log.fine("Type=" + e.getType()); + if (log.isLoggable(Level.FINE)) log.fine("Type=" + e.getType()); } // tableChanged /*************************************************************************/ @@ -154,7 +154,7 @@ public class ResultTable extends JTable implements MouseListener public void mouseClicked(MouseEvent e) { int col = getColumnModel().getColumnIndexAtX(e.getX()); - log.fine("Column " + col + " = " + getColumnModel().getColumn(col).getHeaderValue() + if (log.isLoggable(Level.FINE)) log.fine("Column " + col + " = " + getColumnModel().getColumn(col).getHeaderValue() + ", Table r=" + this.getSelectedRow() + " c=" + this.getSelectedColumn()); // clicked Cell diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/ColorBlind.java b/org.adempiere.ui.swing/src/org/compiere/swing/ColorBlind.java index 0eb244ae2a..10a46e4260 100644 --- a/org.adempiere.ui.swing/src/org/compiere/swing/ColorBlind.java +++ b/org.adempiere.ui.swing/src/org/compiere/swing/ColorBlind.java @@ -281,7 +281,7 @@ public class ColorBlind // System.out.println("Red: " + red * 255.0 + " Green: " + green * 255.0 + " Blue: " + blue * 255.0); Color retValue = new Color((float)red, (float)green, (float)blue); - log.fine("Color " + color.getRed() + "-" + color.getGreen() + "-" + color.getBlue() + if (log.isLoggable(Level.FINE)) log.fine("Color " + color.getRed() + "-" + color.getGreen() + "-" + color.getBlue() + " -> " + retValue.getRed() + "-" + retValue.getGreen() + "-" + retValue.getBlue() + " <- " + COLORBLIND_TYPE[colorType]); return retValue; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java index 4d9268df66..60b9c53734 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java @@ -484,7 +484,7 @@ public class ValuePreference extends Window implements EventListener sql.append(" AND AD_Window_ID IS NULL"); sql.append(" AND Attribute='").append(m_Attribute).append("'"); // - log.fine( sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine( sql.toString()); int no = DB.executeUpdate(sql.toString(), null); if (no > 0) Env.setContext(m_ctx, getContextKey(), (String)null); @@ -548,7 +548,7 @@ public class ValuePreference extends Window implements EventListener // sql.append(DB.TO_STRING(m_Attribute)).append(",").append(DB.TO_STRING(m_Value)).append(")"); // - log.fine( sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine( sql.toString()); no = DB.executeUpdate(sql.toString(), null); if (no == 1) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WZoomAcross.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WZoomAcross.java index a813f5159a..bcbb236cab 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WZoomAcross.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WZoomAcross.java @@ -105,7 +105,7 @@ public class WZoomAcross windowID)) { if (zoomInfo.query.getRecordCount() == 0) { - log.fine("No target records for destination " + if (log.isLoggable(Level.FINE)) log.fine("No target records for destination " + zoomInfo.destinationDisplay); continue; } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java index 9e7c6f8e48..455f4dcdd9 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java @@ -192,32 +192,32 @@ public class ADSortTab extends Panel implements IADTabpanel // Sort Column if (AD_ColumnSortOrder_ID == rs.getInt(2)) { - log.fine("Sort=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("Sort=" + rs.getString(1) + "." + rs.getString(3)); m_ColumnSortName = rs.getString(3); yesLabel.setValue(rs.getString(4)); } // Optional YesNo else if (AD_ColumnSortYesNo_ID == rs.getInt(2)) { - log.fine("YesNo=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("YesNo=" + rs.getString(1) + "." + rs.getString(3)); m_ColumnYesNoName = rs.getString(3); } // Parent2 else if (rs.getString(5).equals("Y")) { - log.fine("Parent=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("Parent=" + rs.getString(1) + "." + rs.getString(3)); m_ParentColumnName = rs.getString(3); } // KeyColumn else if (rs.getString(6).equals("Y")) { - log.fine("Key=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("Key=" + rs.getString(1) + "." + rs.getString(3)); m_KeyColumnName = rs.getString(3); } // Identifier else if (rs.getString(7).equals("Y")) { - log.fine("Identifier=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("Identifier=" + rs.getString(1) + "." + rs.getString(3)); boolean isTranslated = trl && "Y".equals(rs.getString(8)); if (identifierSql.length() > 0) identifierSql.append(","); @@ -228,7 +228,7 @@ public class ADSortTab extends Panel implements IADTabpanel m_IdentifierTranslated = true; } else - log.fine("??NotUsed??=" + rs.getString(1) + "." + rs.getString(3)); + if (log.isLoggable(Level.FINE)) log.fine("??NotUsed??=" + rs.getString(1) + "." + rs.getString(3)); } } catch (SQLException e) @@ -403,7 +403,7 @@ public class ADSortTab extends Panel implements IADTabpanel if(m_ParentColumnName != null) { ID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, m_ParentColumnName); - log.fine(sql.toString() + " - ID=" + ID); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString() + " - ID=" + ID); } else { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java index 2b263fca56..f2b39bfffc 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessParameterPanel.java @@ -483,7 +483,7 @@ public class ProcessParameterPanel extends Panel implements para.setInfo_To(editor2.getDisplay()); // para.saveEx(); - log.fine(para.toString()); + if (log.isLoggable(Level.FINE)) log.fine(para.toString()); } // for every parameter return true; @@ -578,7 +578,7 @@ public class ProcessParameterPanel extends Panel implements // if the lookup is dynamic (i.e. contains this columnName as variable) if (mLookup.getValidation().indexOf("@"+columnName+"@") != -1) { - log.fine(columnName + " changed - " + if (log.isLoggable(Level.FINE)) log.fine(columnName + " changed - " + field.getColumnName() + " set to null"); // invalidate current selection field.setValue(null, true); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/WProcessCtl.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/WProcessCtl.java index 7c174ae8c7..ca9994d3b9 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/WProcessCtl.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/WProcessCtl.java @@ -16,6 +16,8 @@ *****************************************************************************/ package org.adempiere.webui.apps; +import java.util.logging.Level; + import org.adempiere.util.IProcessUI; import org.adempiere.webui.component.Window; import org.compiere.apps.AbstractProcessCtl; @@ -54,7 +56,7 @@ public class WProcessCtl extends AbstractProcessCtl { */ public static void process (int WindowNo, ProcessInfo pi, Trx trx) { - log.fine("WindowNo=" + WindowNo + " - " + pi); + if (log.isLoggable(Level.FINE)) log.fine("WindowNo=" + WindowNo + " - " + pi); MPInstance instance = null; try @@ -112,7 +114,7 @@ public class WProcessCtl extends AbstractProcessCtl { */ public static void process(IProcessUI aProcessUI, int WindowNo, IProcessParameter parameter, ProcessInfo pi, Trx trx) { - log.fine("WindowNo=" + WindowNo + " - " + pi); + if (log.isLoggable(Level.FINE)) log.fine("WindowNo=" + WindowNo + " - " + pi); MPInstance instance = null; try diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WBOMDrop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WBOMDrop.java index 38d5780c31..01ba67c4d1 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WBOMDrop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WBOMDrop.java @@ -422,7 +422,7 @@ public class WBOMDrop extends ADForm implements EventListener grpSelectProd.appendChild(new Separator()); } - log.fine("#" + bomLines.length); + if (log.isLoggable(Level.FINE)) log.fine("#" + bomLines.length); } // addBOMLines /** @@ -434,7 +434,7 @@ public class WBOMDrop extends ADForm implements EventListener private void addBOMLine (MProductBOM line, BigDecimal qty) { - log.fine(line.toString()); + if (log.isLoggable(Level.FINE)) log.fine(line.toString()); String bomType = line.getBOMType(); if (bomType == null) @@ -465,7 +465,7 @@ public class WBOMDrop extends ADForm implements EventListener private void addDisplay (int parentM_Product_ID, int M_Product_ID, String bomType, String name, BigDecimal lineQty) { - log.fine("M_Product_ID=" + M_Product_ID + ",Type=" + bomType + ",Name=" + name + ",Qty=" + lineQty); + if (log.isLoggable(Level.FINE)) log.fine("M_Product_ID=" + M_Product_ID + ",Type=" + bomType + ",Name=" + name + ",Qty=" + lineQty); boolean selected = true; @@ -507,7 +507,7 @@ public class WBOMDrop extends ADForm implements EventListener if (group == null) { - log.fine("ButtonGroup=" + groupName); + if (log.isLoggable(Level.FINE)) log.fine("ButtonGroup=" + groupName); group = new Radiogroup(); m_buttonGroups.put(groupName, group); group.appendChild(b); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java index 7274f49851..1da5d18c93 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WResetPassword.java @@ -266,13 +266,13 @@ public class WResetPassword implements IFormController, EventListener, Va String p_NewEMailUserPW = txtNewEMailUserPW.getValue(); MUser user = MUser.get(Env.getCtx(), p_AD_User_ID); - log.fine("User=" + user); + if (log.isLoggable(Level.FINE)) log.fine("User=" + user); // Do we need a password ? if (Util.isEmpty(p_OldPassword)) // Password required { MUser operator = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx())); - log.fine("Operator=" + operator); + if (log.isLoggable(Level.FINE)) log.fine("Operator=" + operator); if (p_AD_User_ID == 0 // change of System || p_AD_User_ID == 100 // change of SuperUser diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WFPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WFPanel.java index 8327461fc6..0c0072553f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WFPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WFPanel.java @@ -150,7 +150,7 @@ public class WFPanel extends Borderlayout implements EventListener */ public void load (int AD_Workflow_ID) { - log.fine("AD_Workflow_ID=" + AD_Workflow_ID); + if (log.isLoggable(Level.FINE)) log.fine("AD_Workflow_ID=" + AD_Workflow_ID); if (AD_Workflow_ID == 0) return; // Get Workflow diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java index 40f94d37cd..af390625e1 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/wf/WWFActivity.java @@ -397,7 +397,7 @@ public class WWFActivity extends ADForm implements EventListener m_activities = new MWFActivity[list.size ()]; list.toArray (m_activities); // - log.fine("#" + m_activities.length + if (log.isLoggable(Level.FINE)) log.fine("#" + m_activities.length + "(" + (System.currentTimeMillis()-start) + "ms)"); m_index = 0; @@ -488,7 +488,7 @@ public class WWFActivity extends ADForm implements EventListener */ public void display (int index) { - log.fine("Index=" + index); + if (log.isLoggable(Level.FINE)) log.fine("Index=" + index); // m_activity = resetDisplay(index); // Nothing to show diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java index 60f9e2bd81..c2bdcfb0aa 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ADTreeOnDropListener.java @@ -12,6 +12,8 @@ *****************************************************************************/ package org.adempiere.webui.component; +import java.util.logging.Level; + import org.adempiere.webui.util.TreeUtils; import org.adempiere.webui.window.FDialog; import org.compiere.model.MTree; @@ -65,7 +67,7 @@ public class ADTreeOnDropListener implements EventListener { public void onEvent(Event event) throws Exception { if (event instanceof DropEvent) { DropEvent de = (DropEvent) event; - log.fine("Source=" + de.getDragged() + " Target=" + de.getTarget()); + if (log.isLoggable(Level.FINE)) log.fine("Source=" + de.getDragged() + " Target=" + de.getTarget()); if (de.getDragged() != de.getTarget()) { Treeitem src = (Treeitem) ((Treerow) de.getDragged()).getParent(); Treeitem target = (Treeitem) ((Treerow) de.getTarget()).getParent(); @@ -172,7 +174,7 @@ public class ADTreeOnDropListener implements EventListener { .append(", Updated=SysDate") .append(" WHERE AD_Tree_ID=").append(mTree.getAD_Tree_ID()) .append(" AND Node_ID=").append(md.getNode_ID()); - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); no = DB.executeUpdate(sql.toString(),trx.getTrxName()); } if (oldParent != newParent) @@ -189,7 +191,7 @@ public class ADTreeOnDropListener implements EventListener { .append(", Updated=SysDate") .append(" WHERE AD_Tree_ID=").append(mTree.getAD_Tree_ID()) .append(" AND Node_ID=").append(md.getNode_ID()); - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); no = DB.executeUpdate(sql.toString(),trx.getTrxName()); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/RequestWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/RequestWindow.java index 982e2b7d34..2f5f15b098 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/RequestWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/RequestWindow.java @@ -14,6 +14,7 @@ package org.adempiere.webui.dashboard; import java.sql.Timestamp; +import java.util.logging.Level; import org.adempiere.webui.component.Borderlayout; import org.adempiere.webui.component.Column; @@ -290,7 +291,7 @@ public class RequestWindow extends Window implements EventListener { if (request.save()) { - log.fine("R_Request_ID=" + request.getR_Request_ID()); + if (log.isLoggable(Level.FINE)) log.fine("R_Request_ID=" + request.getR_Request_ID()); Events.postEvent("onRefresh", parent, null); // Events.echoEvent("onRefresh", parent, null); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WImageEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WImageEditor.java index 7692eb6507..bad8670ea9 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WImageEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WImageEditor.java @@ -132,7 +132,7 @@ public class WImageEditor extends WEditor if (m_mImage == null || newValue != m_mImage.get_ID()) m_mImage = MImage.get (Env.getCtx(), newValue); // - log.fine(m_mImage.toString()); + if (log.isLoggable(Level.FINE)) log.fine(m_mImage.toString()); AImage img = null; byte[] data = m_mImage.getData(); if (data != null && data.length > 0) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java index e16beedfec..b7db382cec 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WPAttributeEditor.java @@ -103,7 +103,7 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener if (value.equals(m_value)) return; // new value - log.fine("Value=" + value); + if (log.isLoggable(Level.FINE)) log.fine("Value=" + value); m_value = value; getComponent().setText(m_mPAttribute.getDisplay(value)); // loads value } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/grid/WBPartner.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/grid/WBPartner.java index bc97f88443..e1ea5d4799 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/grid/WBPartner.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/grid/WBPartner.java @@ -437,7 +437,7 @@ public class WBPartner extends Window implements EventListener, ValueChan m_partner.setC_Greeting_ID(0); if (m_partner.save()) - log.fine("C_BPartner_ID=" + m_partner.getC_BPartner_ID()); + if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_ID=" + m_partner.getC_BPartner_ID()); else { FDialog.error(m_WindowNo, this, "BPartnerNotSaved"); m_partner = null; @@ -456,7 +456,7 @@ public class WBPartner extends Window implements EventListener, ValueChan m_pLocation.setFax(fFax.getText()); if (m_pLocation.save()) - log.fine("C_BPartner_Location_ID=" + m_pLocation.getC_BPartner_Location_ID()); + if (log.isLoggable(Level.FINE)) log.fine("C_BPartner_Location_ID=" + m_pLocation.getC_BPartner_Location_ID()); else FDialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "C_BPartner_Location_ID")); @@ -490,7 +490,7 @@ public class WBPartner extends Window implements EventListener, ValueChan m_user.setFax(fFax.getText()); if (m_user.save()) - log.fine("AD_User_ID=" + m_user.getAD_User_ID()); + if (log.isLoggable(Level.FINE)) log.fine("AD_User_ID=" + m_user.getAD_User_ID()); else FDialog.error(m_WindowNo, this, "BPartnerNotSaved", Msg.translate(Env.getCtx(), "AD_User_ID")); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java index 0da3a174b9..d074d41cb1 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoAssetPanel.java @@ -20,6 +20,7 @@ package org.adempiere.webui.panel; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; +import java.util.logging.Level; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.component.Grid; @@ -324,7 +325,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev value += "%"; pstmt.setString(index++, value); - log.fine("Value: " + value); + if (log.isLoggable(Level.FINE)) log.fine("Value: " + value); } // => Name @@ -337,7 +338,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev name += "%"; pstmt.setString(index++, name); - log.fine("Name: " + name); + if (log.isLoggable(Level.FINE)) log.fine("Name: " + name); } } // setParameters diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java index 14d068ddab..a02e9ef782 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoBPartnerPanel.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.ArrayList; +import java.util.logging.Level; import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.apps.AEnv; @@ -354,7 +355,7 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener if (!value.endsWith("%")) value += "%"; pstmt.setString(index++, value); - log.fine("Value: " + value); + if (log.isLoggable(Level.FINE)) log.fine("Value: " + value); } // => Name String name = fieldName.getText().toUpperCase(); @@ -363,7 +364,7 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener if (!name.endsWith("%")) name += "%"; pstmt.setString(index++, name); - log.fine("Name: " + name); + if (log.isLoggable(Level.FINE)) log.fine("Name: " + name); } // => Contact String contact = fieldContact.getText().toUpperCase(); @@ -372,7 +373,7 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener if (!contact.endsWith("%")) contact += "%"; pstmt.setString(index++, contact); - log.fine("Contact: " + contact); + if (log.isLoggable(Level.FINE)) log.fine("Contact: " + contact); } // => EMail String email = fieldEMail.getText().toUpperCase(); @@ -381,7 +382,7 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener if (!email.endsWith("%")) email += "%"; pstmt.setString(index++, email); - log.fine("EMail: " + email); + if (log.isLoggable(Level.FINE)) log.fine("EMail: " + email); } // => Phone String phone = fieldPhone.getText().toUpperCase(); @@ -390,7 +391,7 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener if (!phone.endsWith("%")) phone += "%"; pstmt.setString(index++, phone); - log.fine("Phone: " + phone); + if (log.isLoggable(Level.FINE)) log.fine("Phone: " + phone); } // => Postal String postal = fieldPostal.getText().toUpperCase(); @@ -399,7 +400,7 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener if (!postal.endsWith("%")) postal += "%"; pstmt.setString(index++, postal); - log.fine("Postal: " + postal); + if (log.isLoggable(Level.FINE)) log.fine("Postal: " + postal); } } // setParameters diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java index 5672530611..143029c265 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoCashLinePanel.java @@ -22,6 +22,7 @@ import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; import java.util.Date; +import java.util.logging.Level; import org.adempiere.webui.component.Checkbox; import org.adempiere.webui.component.Datebox; @@ -366,7 +367,7 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener, } } - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); return sql.toString(); } // getSQLWhere @@ -392,14 +393,14 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener, { Integer cb = (Integer)fCashBook_ID.getValue(); pstmt.setInt(index++, cb.intValue()); - log.fine("CashBook=" + cb); + if (log.isLoggable(Level.FINE)) log.fine("CashBook=" + cb); } if (fInvoice_ID.getValue() != null) { Integer i = (Integer)fInvoice_ID.getValue(); pstmt.setInt(index++, i.intValue()); - log.fine("Invoice=" + i); + if (log.isLoggable(Level.FINE)) log.fine("Invoice=" + i); } if (fDateFrom.getValue() != null || fDateTo.getValue() != null) @@ -414,7 +415,7 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener, if (t != null) to = new Timestamp(t.getTime()); - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setTimestamp(index++, to); @@ -440,7 +441,7 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener, to = to.abs(); } - log.fine("Amt From=" + from + ", To=" + to + ", Absolute=" + cbAbsolute.isChecked()); + if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to + ", Absolute=" + cbAbsolute.isChecked()); if (from == null && to != null) pstmt.setBigDecimal(index++, to); @@ -472,7 +473,7 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener, if (!s.endsWith("%")) s += "%"; - log.fine( "String=" + s); + if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); return s; } // getSQLText diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java index af4962ced9..119ec82857 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java @@ -463,7 +463,7 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener String s = f.getText().toUpperCase(); if (!s.endsWith("%")) s += "%"; - log.fine( "String=" + s); + if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); return s; } // getSQLText diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java index 58c41470e6..2fbebc845e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInOutPanel.java @@ -21,6 +21,7 @@ import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; import java.util.Date; +import java.util.logging.Level; import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.apps.AEnv; @@ -357,7 +358,7 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev { Integer bp = (Integer)fBPartner_ID.getValue(); pstmt.setInt(index++, bp.intValue()); - log.fine("BPartner=" + bp); + if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); } if (fDateFrom.getValue() != null || fDateTo.getValue() != null) @@ -372,7 +373,7 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev if (t != null) to = new Timestamp(t.getTime()); - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setTimestamp(index++, to); @@ -400,7 +401,7 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev if (!s.endsWith("%")) s += "%"; - log.fine( "String=" + s); + if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); return s; } // getSQLText diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java index a44287cb93..c0a3c79ee2 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoInvoicePanel.java @@ -417,14 +417,14 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener { Integer bp = (Integer)editorBPartner.getValue(); pstmt.setInt(index++, bp.intValue()); - log.fine("BPartner=" + bp); + if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); } // if (editorOrder.getValue() != null) { Integer order = (Integer)editorOrder.getValue(); pstmt.setInt(index++, order.intValue()); - log.fine("Order=" + order); + if (log.isLoggable(Level.FINE)) log.fine("Order=" + order); } Date fromD = null; Date toD = null; @@ -455,7 +455,7 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener } - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if (from == null && to != null) { pstmt.setTimestamp(index++, to); @@ -530,7 +530,7 @@ public class InfoInvoicePanel extends InfoPanel implements ValueChangeListener String s = f.getText().toUpperCase(); if (!s.endsWith("%")) s += "%"; - log.fine("String=" + s); + if (log.isLoggable(Level.FINE)) log.fine("String=" + s); return s; } // getSQLText diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java index 6863d30564..b3c00f12e2 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoOrderPanel.java @@ -393,7 +393,7 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener { Integer bp = (Integer)editorBPartner.getValue(); pstmt.setInt(index++, bp.intValue()); - log.fine("BPartner=" + bp); + if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); } // @@ -426,7 +426,7 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener } - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if (from == null && to != null) { pstmt.setTimestamp(index++, to); @@ -501,7 +501,7 @@ public class InfoOrderPanel extends InfoPanel implements ValueChangeListener String s = f.getText().toUpperCase(); if (!s.endsWith("%")) s += "%"; - log.fine("String=" + s); + if (log.isLoggable(Level.FINE)) log.fine("String=" + s); return s; } // getSQLText diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPAttributeInstancePanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPAttributeInstancePanel.java index a636f78a37..ad4ae3f798 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPAttributeInstancePanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPAttributeInstancePanel.java @@ -339,7 +339,7 @@ public class InfoPAttributeInstancePanel extends Window implements EventListener } } confirmPanel.getOKButton().setEnabled(enabled); - log.fine("M_AttributeSetInstance_ID=" + m_M_AttributeSetInstance_ID + if (log.isLoggable(Level.FINE)) log.fine("M_AttributeSetInstance_ID=" + m_M_AttributeSetInstance_ID + " - " + m_M_AttributeSetInstanceName + "; M_Locator_ID=" + m_M_Locator_ID); } // enableButtons diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java index aea35694dd..028ab63fa6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoPaymentPanel.java @@ -22,6 +22,7 @@ import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; import java.util.Date; +import java.util.logging.Level; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.component.Checkbox; @@ -360,7 +361,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, sql.append(" AND p.IsReceipt=?"); - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); return sql.toString(); } // getSQLWhere @@ -383,7 +384,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, { Integer bp = (Integer)fBPartner_ID.getValue(); pstmt.setInt(index++, bp.intValue()); - log.fine("BPartner=" + bp); + if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + bp); } if (fDateFrom.getValue() != null || fDateTo.getValue() != null) @@ -398,7 +399,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, if (t != null) to = new Timestamp(t.getTime()); - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setTimestamp(index++, to); @@ -433,7 +434,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, } } - log.fine("Amt From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to); if (from == null && to != null) pstmt.setBigDecimal(index++, to); @@ -462,7 +463,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener, if (!s.endsWith("%")) s += "%"; - log.fine( "String=" + s); + if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); return s; } // getSQLText diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java index e0c28cd45d..59939ff9f8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoProductPanel.java @@ -644,7 +644,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener rs = null; pstmt = null; } - log.fine("#" + m_count + " - " + (System.currentTimeMillis()-start) + "ms"); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_count + " - " + (System.currentTimeMillis()-start) + "ms"); return true; } @@ -1050,7 +1050,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener pstmt.setInt(index++, M_Warehouse_ID); } } - log.fine("M_Warehouse_ID=" + M_Warehouse_ID + " (" + (index-1) + "*)"); + if (log.isLoggable(Level.FINE)) log.fine("M_Warehouse_ID=" + M_Warehouse_ID + " (" + (index-1) + "*)"); // => PriceList int M_PriceList_Version_ID = 0; @@ -1060,20 +1060,20 @@ public class InfoProductPanel extends InfoPanel implements EventListener if (M_PriceList_Version_ID != 0) { pstmt.setInt(index++, M_PriceList_Version_ID); - log.fine("M_PriceList_Version_ID=" + M_PriceList_Version_ID); + if (log.isLoggable(Level.FINE)) log.fine("M_PriceList_Version_ID=" + M_PriceList_Version_ID); } // Elaine 2008/11/29 // => Product Category int M_Product_Category_ID = getM_Product_Category_ID(); if (M_Product_Category_ID > 0) { pstmt.setInt(index++, M_Product_Category_ID); - log.fine("M_Product_Category_ID=" + M_Product_Category_ID); + if (log.isLoggable(Level.FINE)) log.fine("M_Product_Category_ID=" + M_Product_Category_ID); } // int M_AttributeSet_ID = getM_AttributeSet_ID(); if (M_AttributeSet_ID > 0) { pstmt.setInt(index++, M_AttributeSet_ID); - log.fine("M_AttributeSet_ID=" + M_AttributeSet_ID); + if (log.isLoggable(Level.FINE)) log.fine("M_AttributeSet_ID=" + M_AttributeSet_ID); } // Rest of Parameter in Query for Attribute Search if (m_pAttributeWhere != null) @@ -1086,7 +1086,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener if (!value.endsWith("%")) value += "%"; pstmt.setString(index++, value); - log.fine("Value: " + value); + if (log.isLoggable(Level.FINE)) log.fine("Value: " + value); } // => Name @@ -1096,7 +1096,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener if (!name.endsWith("%")) name += "%"; pstmt.setString(index++, name); - log.fine("Name: " + name); + if (log.isLoggable(Level.FINE)) log.fine("Name: " + name); } // => UPC @@ -1106,7 +1106,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener if (!upc.endsWith("%")) upc += "%"; pstmt.setString(index++, upc); - log.fine("UPC: " + upc); + if (log.isLoggable(Level.FINE)) log.fine("UPC: " + upc); } // => SKU @@ -1116,7 +1116,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener if (!sku.endsWith("%")) sku += "%"; pstmt.setString(index++, sku); - log.fine("SKU: " + sku); + if (log.isLoggable(Level.FINE)) log.fine("SKU: " + sku); } // => Vendor @@ -1126,7 +1126,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener if (!vendor.endsWith("%")) vendor += "%"; pstmt.setString(index++, vendor); - log.fine("Vendor: " + vendor); + if (log.isLoggable(Level.FINE)) log.fine("Vendor: " + vendor); } } // setParameters diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InvoiceHistory.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InvoiceHistory.java index 14e2357cbc..dd011a7ec8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InvoiceHistory.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InvoiceHistory.java @@ -295,7 +295,7 @@ public class InvoiceHistory extends Window implements EventListener */ private Vector> fillTable (String sql, int parameter) { - log.fine(sql + "; Parameter=" + parameter); + if (log.isLoggable(Level.FINE)) log.fine(sql + "; Parameter=" + parameter); Vector> data = new Vector>(); PreparedStatement pstmt = null; ResultSet rs = null; @@ -340,7 +340,7 @@ public class InvoiceHistory extends Window implements EventListener DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + data.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + data.size()); return data; } // fillTable @@ -350,7 +350,7 @@ public class InvoiceHistory extends Window implements EventListener */ private void fillLabel (String sql, int parameter) { - log.fine(sql + "; Parameter=" + parameter); + if (log.isLoggable(Level.FINE)) log.fine(sql + "; Parameter=" + parameter); String retValue = DB.getSQLValueString(null, sql, parameter); if (retValue != null) label.setText(retValue); @@ -555,7 +555,7 @@ public class InvoiceHistory extends Window implements EventListener DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("#" + data.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + data.size()); // Table m_modelUnconfirmed = new ListModelTable(data); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java index f3a7716069..24d0189ec3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java @@ -204,7 +204,7 @@ public class InvoicePrint extends SvrProcess } } sql.append(" ORDER BY i.C_Invoice_ID, pf.AD_Org_ID DESC"); // more than 1 PF record - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); MPrintFormat format = null; int old_AD_PrintFormat_ID = -1; @@ -308,7 +308,7 @@ public class InvoicePrint extends SvrProcess if (!Ini.isClient()) invoice = new File(MInvoice.getPDFFileName(documentDir, C_Invoice_ID)); File attachment = re.getPDF(invoice); - log.fine(to + " - " + attachment); + if (log.isLoggable(Level.FINE)) log.fine(to + " - " + attachment); email.addAttachment(attachment); // String msg = email.send(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index f45e56f0df..824ce6de6e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -1690,7 +1690,7 @@ public class FindWindow extends Window implements EventListener, ValueCha { String ColumnName = wed.getColumnName(); StringBuilder msglog = new StringBuilder(ColumnName).append("=").append(value); - log.fine(msglog.toString()); + if (log.isLoggable(Level.FINE)) log.fine(msglog.toString()); // globalqss - Carlos Ruiz - 20060711 // fix a bug with virtualColumn + isSelectionColumn not yielding results @@ -1969,7 +1969,7 @@ public class FindWindow extends Window implements EventListener, ValueCha ret.append(getSubCategoriesString(node.getNodeId(), categories, loopIndicatorId)).append(","); } } - log.fine(ret.toString()); + if (log.isLoggable(Level.FINE)) log.fine(ret.toString()); StringBuilder msgreturn = new StringBuilder(ret.toString()).append(productCategoryId); return msgreturn.toString(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java index 2acc32d361..b07af78c32 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java @@ -473,7 +473,7 @@ public final class WAccountDialog extends Window */ private void addLine (GridField field, WEditor editor, boolean mandatory) { - log.fine("Field=" + field); + if (log.isLoggable(Level.FINE)) log.fine("Field=" + field); Label label = editor.getLabel(); editor.setReadWrite(true); editor.setMandatory(mandatory); @@ -508,7 +508,7 @@ public final class WAccountDialog extends Window */ private void loadInfo (int C_ValidCombination_ID, int C_AcctSchema_ID) { - log.fine("C_ValidCombination_ID=" + C_ValidCombination_ID); + if (log.isLoggable(Level.FINE)) log.fine("C_ValidCombination_ID=" + C_ValidCombination_ID); String sql = "SELECT * FROM C_ValidCombination WHERE C_ValidCombination_ID=? AND C_AcctSchema_ID=?"; PreparedStatement pstmt = null; ResultSet rs = null; @@ -912,7 +912,7 @@ public final class WAccountDialog extends Window * Check if already exists */ sql.append("AD_Client_ID=? AND C_AcctSchema_ID=?"); - log.fine("Check = " + sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine("Check = " + sql.toString()); int IDvalue = 0; String Alias = null; PreparedStatement pstmt = null; @@ -940,7 +940,7 @@ public final class WAccountDialog extends Window rs = null; pstmt = null; } - log.fine("ID=" + IDvalue + ", Alias=" + Alias); + if (log.isLoggable(Level.FINE)) log.fine("ID=" + IDvalue + ", Alias=" + Alias); if (Alias == null) Alias = ""; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java index a518c3a8a2..697a2f1124 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocationDialog.java @@ -336,7 +336,7 @@ public class WLocationDialog extends Window implements EventListener mainPanel.getRows().getChildren().clear(); MCountry country = m_location.getCountry(); - log.fine(country.getName() + ", Region=" + country.isHasRegion() + " " + country.getCaptureSequence() + if (log.isLoggable(Level.FINE)) log.fine(country.getName() + ", Region=" + country.isHasRegion() + " " + country.getCaptureSequence() + ", C_Location_ID=" + m_location.getC_Location_ID()); // new Country if (m_location.getC_Country_ID() != s_oldCountry_ID) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java index 42c17c8409..818fccb8b6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java @@ -327,13 +327,13 @@ public class WLocatorDialog extends Window implements EventListener pstmt = null; } - log.fine("Warehouses=" + lstWarehouse.getItemCount()); + if (log.isLoggable(Level.FINE)) log.fine("Warehouses=" + lstWarehouse.getItemCount()); // Load existing Locators m_mLocator.fillComboBox(m_mandatory, true, true, false, false); // IDEMPIERE 90 - log.fine(m_mLocator.toString()); + if (log.isLoggable(Level.FINE)) log.fine(m_mLocator.toString()); for (int i = 0; i < m_mLocator.getSize(); i++) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeDialog.java index 5f060b2a66..ec8ef5840e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeDialog.java @@ -298,7 +298,7 @@ public class WPAttributeDialog extends Window implements EventListener row.appendChild(bNewRecord); row.appendChild(new Space()); MAttribute[] attributes = as.getMAttributes (false); - log.fine ("Product Attributes=" + attributes.length); + if (log.isLoggable(Level.FINE)) log.fine ("Product Attributes=" + attributes.length); for (int i = 0; i < attributes.length; i++) addAttributeLine (rows, attributes[i], true, false); if (m_M_AttributeSetInstance_ID > 0) @@ -333,7 +333,7 @@ public class WPAttributeDialog extends Window implements EventListener // All Attributes MAttribute[] attributes = as.getMAttributes (true); - log.fine ("Instance Attributes=" + attributes.length); + if (log.isLoggable(Level.FINE)) log.fine ("Instance Attributes=" + attributes.length); for (int i = 0; i < attributes.length; i++) addAttributeLine (rows, attributes[i], false, false); } @@ -498,7 +498,7 @@ public class WPAttributeDialog extends Window implements EventListener */ private void addAttributeLine (Rows rows, MAttribute attribute, boolean product, boolean readOnly) { - log.fine(attribute + ", Product=" + product + ", R/O=" + readOnly); + if (log.isLoggable(Level.FINE)) log.fine(attribute + ", Product=" + product + ", R/O=" + readOnly); m_row++; Label label = new Label (attribute.getName()); @@ -600,12 +600,12 @@ public class WPAttributeDialog extends Window implements EventListener } } if (found) - log.fine("Attribute=" + attribute.getName() + " #" + values.length + " - found: " + instance); + if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " - found: " + instance); else log.warning("Attribute=" + attribute.getName() + " #" + values.length + " - NOT found: " + instance); } // setComboBox else - log.fine("Attribute=" + attribute.getName() + " #" + values.length + " no instance"); + if (log.isLoggable(Level.FINE)) log.fine("Attribute=" + attribute.getName() + " #" + values.length + " no instance"); } /** @@ -717,7 +717,7 @@ public class WPAttributeDialog extends Window implements EventListener // Get Attribute Set MAttributeSet as = m_masi.getMAttributeSet(); MAttribute[] attributes = as.getMAttributes (false); - log.fine ("Product Attributes=" + attributes.length); + if (log.isLoggable(Level.FINE)) log.fine ("Product Attributes=" + attributes.length); for (int i = 0; i < attributes.length; i++) updateAttributeEditor(attributes[i], i); @@ -914,7 +914,7 @@ public class WPAttributeDialog extends Window implements EventListener String mandatory = ""; if (!m_productWindow && as.isLot()) { - log.fine("Lot=" + fieldLotString.getText ()); + if (log.isLoggable(Level.FINE)) log.fine("Lot=" + fieldLotString.getText ()); String text = fieldLotString.getText(); m_masi.setLot (text); if (as.isLotMandatory() && (text == null || text.length() == 0)) @@ -923,7 +923,7 @@ public class WPAttributeDialog extends Window implements EventListener } // Lot if (!m_productWindow && as.isSerNo()) { - log.fine("SerNo=" + fieldSerNo.getText()); + if (log.isLoggable(Level.FINE)) log.fine("SerNo=" + fieldSerNo.getText()); String text = fieldSerNo.getText(); m_masi.setSerNo(text); if (as.isSerNoMandatory() && (text == null || text.length() == 0)) @@ -932,7 +932,7 @@ public class WPAttributeDialog extends Window implements EventListener } // SerNo if (!m_productWindow && as.isGuaranteeDate()) { - log.fine("GuaranteeDate=" + fieldGuaranteeDate.getValue()); + if (log.isLoggable(Level.FINE)) log.fine("GuaranteeDate=" + fieldGuaranteeDate.getValue()); Date gDate = fieldGuaranteeDate.getValue(); Timestamp ts = gDate != null ? new Timestamp(gDate.getTime()) : null; m_masi.setGuaranteeDate(ts); @@ -959,7 +959,7 @@ public class WPAttributeDialog extends Window implements EventListener Listbox editor = (Listbox)m_editors.get(i); ListItem item = editor.getSelectedItem(); MAttributeValue value = item != null ? (MAttributeValue)item.getValue() : null; - log.fine(attributes[i].getName() + "=" + value); + if (log.isLoggable(Level.FINE)) log.fine(attributes[i].getName() + "=" + value); if (attributes[i].isMandatory() && value == null) mandatory += " - " + attributes[i].getName(); attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value); @@ -968,7 +968,7 @@ public class WPAttributeDialog extends Window implements EventListener { NumberBox editor = (NumberBox)m_editors.get(i); BigDecimal value = editor.getValue(); - log.fine(attributes[i].getName() + "=" + value); + if (log.isLoggable(Level.FINE)) log.fine(attributes[i].getName() + "=" + value); if (attributes[i].isMandatory() && value == null) mandatory += " - " + attributes[i].getName(); //setMAttributeInstance doesn't work without decimal point @@ -980,7 +980,7 @@ public class WPAttributeDialog extends Window implements EventListener { Textbox editor = (Textbox)m_editors.get(i); String value = editor.getText(); - log.fine(attributes[i].getName() + "=" + value); + if (log.isLoggable(Level.FINE)) log.fine(attributes[i].getName() + "=" + value); if (attributes[i].isMandatory() && (value == null || value.length() == 0)) mandatory += " - " + attributes[i].getName(); attributes[i].setMAttributeInstance(m_M_AttributeSetInstance_ID, value); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeInstance.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeInstance.java index 7113762ec9..df86416717 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeInstance.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WPAttributeInstance.java @@ -333,7 +333,7 @@ public class WPAttributeInstance extends Window implements EventListener } } confirmPanel.getButton("Ok").setEnabled(enabled); - log.fine("M_AttributeSetInstance_ID=" + m_M_AttributeSetInstance_ID + if (log.isLoggable(Level.FINE)) log.fine("M_AttributeSetInstance_ID=" + m_M_AttributeSetInstance_ID + " - " + m_M_AttributeSetInstanceName + "; M_Locator_ID=" + m_M_Locator_ID); } // enableButtons diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordAccessDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordAccessDialog.java index 256b6e681a..39882bdd9b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordAccessDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WRecordAccessDialog.java @@ -140,7 +140,7 @@ public class WRecordAccessDialog extends Window implements EventListener pstmt = null; } - log.fine("#" + m_recordAccesss.size()); + if (log.isLoggable(Level.FINE)) log.fine("#" + m_recordAccesss.size()); setLine(0, false); } // dynInit @@ -221,7 +221,7 @@ public class WRecordAccessDialog extends Window implements EventListener */ private void setLine (int rowDelta, boolean newRecord) { - log.fine("delta=" + rowDelta + ", new=" + newRecord + if (log.isLoggable(Level.FINE)) log.fine("delta=" + rowDelta + ", new=" + newRecord + " - currentRow=" + m_currentRow + ", size=" + m_recordAccesss.size()); int maxIndex = 0; // nothing defined @@ -301,7 +301,7 @@ public class WRecordAccessDialog extends Window implements EventListener { roleField.setSelectedItem(selection); m_currentData = ra; - log.fine("" + ra); + if (log.isLoggable(Level.FINE)) log.fine("" + ra); } else m_currentData = null; @@ -360,7 +360,7 @@ public class WRecordAccessDialog extends Window implements EventListener m_currentData.setIsDependentEntities(isDependentEntities); boolean success = m_currentData.save(); // - log.fine("Success=" + success); + if (log.isLoggable(Level.FINE)) log.fine("Success=" + success); return success; } // cmd_save @@ -378,7 +378,7 @@ public class WRecordAccessDialog extends Window implements EventListener success = m_currentData.delete(true); m_currentData = null; m_recordAccesss.remove(m_currentRow); - log.fine("Success=" + success); + if (log.isLoggable(Level.FINE)) log.fine("Success=" + success); } return success; } // cmd_delete diff --git a/org.adempiere.ui/src/org/compiere/apps/AbstractProcessCtl.java b/org.adempiere.ui/src/org/compiere/apps/AbstractProcessCtl.java index 8e48de83fc..def4c8350f 100644 --- a/org.adempiere.ui/src/org/compiere/apps/AbstractProcessCtl.java +++ b/org.adempiere.ui/src/org/compiere/apps/AbstractProcessCtl.java @@ -106,7 +106,7 @@ public abstract class AbstractProcessCtl implements Runnable */ public void run () { - log.fine("AD_PInstance_ID=" + m_pi.getAD_PInstance_ID() + if (log.isLoggable(Level.FINE)) log.fine("AD_PInstance_ID=" + m_pi.getAD_PInstance_ID() + ", Record_ID=" + m_pi.getRecord_ID()); // Lock @@ -294,7 +294,7 @@ public abstract class AbstractProcessCtl implements Runnable ProcessInfoUtil.setSummaryFromDB(m_pi); unlock(); } // *** Process submission *** - // log.fine(Log.l3_Util, "ProcessCtl.run - done"); + // if (log.isLoggable(Level.FINE)) log.fine(Log.l3_Util, "ProcessCtl.run - done"); } // run protected abstract void updateProgressWindowTimerEstimate(int estSeconds); @@ -345,7 +345,7 @@ public abstract class AbstractProcessCtl implements Runnable */ private boolean startWorkflow (int AD_Workflow_ID) { - log.fine(AD_Workflow_ID + " - " + m_pi); + if (log.isLoggable(Level.FINE)) log.fine(AD_Workflow_ID + " - " + m_pi); boolean started = false; if (m_IsServerProcess) { @@ -387,7 +387,7 @@ public abstract class AbstractProcessCtl implements Runnable */ private boolean startProcess () { - log.fine(m_pi.toString()); + if (log.isLoggable(Level.FINE)) log.fine(m_pi.toString()); boolean started = false; //hengsin, bug [ 1633995 ] @@ -460,7 +460,7 @@ public abstract class AbstractProcessCtl implements Runnable private boolean startDBProcess (String ProcedureName) { // execute on this thread/connection - log.fine(ProcedureName + "(" + m_pi.getAD_PInstance_ID() + ")"); + if (log.isLoggable(Level.FINE)) log.fine(ProcedureName + "(" + m_pi.getAD_PInstance_ID() + ")"); boolean started = false; if (m_IsServerProcess) { @@ -513,7 +513,7 @@ public abstract class AbstractProcessCtl implements Runnable { return ProcessUtil.startDatabaseProcedure(m_pi, ProcedureName, m_trx); } - // log.fine(Log.l4_Data, "ProcessCtl.startProcess - done"); + // if (log.isLoggable(Level.FINE)) log.fine(Log.l4_Data, "ProcessCtl.startProcess - done"); return true; } // startDBProcess diff --git a/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java b/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java index b07c39bc2c..bab5f2f7c0 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/Allocation.java @@ -137,7 +137,7 @@ public class Allocation // role security sql = new StringBuilder( MRole.getDefault(Env.getCtx(), false).addAccessSQL( sql.toString(), "p", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO ) ); - log.fine("PaySQL=" + sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine("PaySQL=" + sql.toString()); PreparedStatement pstmt = null; ResultSet rs = null; try @@ -265,7 +265,7 @@ public class Allocation if (m_AD_Org_ID != 0 ) sql.append(" AND i.AD_Org_ID=" + m_AD_Org_ID); sql.append(" ORDER BY i.DateInvoiced, i.DocumentNo"); - log.fine("InvSQL=" + sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine("InvSQL=" + sql.toString()); // role security sql = new StringBuilder( MRole.getDefault(Env.getCtx(), false).addAccessSQL( sql.toString(), "i", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO ) ); @@ -561,7 +561,7 @@ public class Allocation BigDecimal bd = (BigDecimal)payment.getValueAt(i, i_payment); totalPay = totalPay.add(bd); // Applied Pay m_noPayments++; - log.fine("Payment_" + i + " = " + bd + " - Total=" + totalPay); + if (log.isLoggable(Level.FINE)) log.fine("Payment_" + i + " = " + bd + " - Total=" + totalPay); } } return String.valueOf(m_noPayments) + " - " @@ -585,7 +585,7 @@ public class Allocation BigDecimal bd = (BigDecimal)invoice.getValueAt(i, i_applied); totalInv = totalInv.add(bd); // Applied Inv m_noInvoices++; - log.fine("Invoice_" + i + " = " + bd + " - Total=" + totalPay); + if (log.isLoggable(Level.FINE)) log.fine("Invoice_" + i + " = " + bd + " - Total=" + totalPay); } } return String.valueOf(m_noInvoices) + " - " @@ -638,7 +638,7 @@ public class Allocation // paymentAppliedAmt = paymentAppliedAmt.add(PaymentAmt); // - log.fine("C_Payment_ID=" + C_Payment_ID + if (log.isLoggable(Level.FINE)) log.fine("C_Payment_ID=" + C_Payment_ID + " - PaymentAmt=" + PaymentAmt); // + " * " + Multiplier + " = " + PaymentAmtAbs); } } @@ -698,7 +698,7 @@ public class Allocation // subtract amount from Payment/Invoice AppliedAmt = AppliedAmt.subtract(amount); PaymentAmt = PaymentAmt.subtract(amount); - log.fine("Allocation Amount=" + amount + " - Remaining Applied=" + AppliedAmt + ", Payment=" + PaymentAmt); + if (log.isLoggable(Level.FINE)) log.fine("Allocation Amount=" + amount + " - Remaining Applied=" + AppliedAmt + ", Payment=" + PaymentAmt); amountList.set(j, PaymentAmt); // update } // for all applied amounts } // loop through payments for invoice @@ -714,7 +714,7 @@ public class Allocation aLine.setDocInfo(C_BPartner_ID, C_Order_ID, C_Invoice_ID); aLine.setPaymentInfo(C_Payment_ID, C_CashLine_ID); aLine.saveEx(); - log.fine("Allocation Amount=" + AppliedAmt); + if (log.isLoggable(Level.FINE)) log.fine("Allocation Amount=" + AppliedAmt); unmatchedApplied = unmatchedApplied.add(AppliedAmt); } } // invoice selected @@ -726,7 +726,7 @@ public class Allocation if ( payAmt.signum() == 0 ) continue; int C_Payment_ID = ((Integer)paymentList.get(i)).intValue(); - log.fine("Payment=" + C_Payment_ID + if (log.isLoggable(Level.FINE)) log.fine("Payment=" + C_Payment_ID + ", Amount=" + payAmt); // Allocation Line diff --git a/org.adempiere.ui/src/org/compiere/apps/form/Archive.java b/org.adempiere.ui/src/org/compiere/apps/form/Archive.java index 8823d98027..3545663392 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/Archive.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/Archive.java @@ -193,7 +193,7 @@ public class Archive { if (createdTo != null) sql.append(" AND Created<").append(DB.TO_DATE(TimeUtil.addDays(createdTo,1), true)); - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); //metas: Bugfix zu included_Role // Process Access diff --git a/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java b/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java index eab1c471bb..4eb1bbf4ce 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java @@ -120,7 +120,7 @@ public class FactReconcile { sql.append(" ORDER BY 1,5,3,6"); - log.fine("SQL=" + sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine("SQL=" + sql.toString()); PreparedStatement pstmt = null; ResultSet rs = null; diff --git a/org.adempiere.ui/src/org/compiere/apps/form/Match.java b/org.adempiere.ui/src/org/compiere/apps/form/Match.java index 64f9e2e046..4ff7de16e3 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/Match.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/Match.java @@ -83,7 +83,7 @@ public class Match */ protected Vector cmd_matchFrom(String selection) { - // log.fine( "VMatch.cmd_matchFrom"); + // if (log.isLoggable(Level.FINE)) log.fine( "VMatch.cmd_matchFrom"); //String selection = (String)matchFrom.getSelectedItem(); Vector vector = new Vector(2); if (selection.equals(m_matchOptions[MATCH_INVOICE])) @@ -240,7 +240,7 @@ public class Match KeyNamePair BPartner = (KeyNamePair)xMatchedTable.getValueAt(row, I_BPartner); //KeyNamePair Org = (KeyNamePair)xMatchedTable.getValueAt(row, I_Org); //JAVIER KeyNamePair Product = (KeyNamePair)xMatchedTable.getValueAt(row, I_Product); - log.fine("BPartner=" + BPartner + " - Product=" + Product); + if (log.isLoggable(Level.FINE)) log.fine("BPartner=" + BPartner + " - Product=" + Product); // if (sameBPartner) m_sql.append(" AND hdr.C_BPartner_ID=").append(BPartner.getKey()); @@ -405,7 +405,7 @@ public class Match { if (qty.compareTo(Env.ZERO) == 0) return true; - log.fine("IsInvoice=" + invoice + if (log.isLoggable(Level.FINE)) log.fine("IsInvoice=" + invoice + ", M_InOutLine_ID=" + M_InOutLine_ID + ", Line_ID=" + Line_ID + ", Qty=" + qty); // diff --git a/org.adempiere.ui/src/org/compiere/apps/form/Merge.java b/org.adempiere.ui/src/org/compiere/apps/form/Merge.java index d888a0ec00..61deafde41 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/Merge.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/Merge.java @@ -191,7 +191,7 @@ public class Merge */ public int mergeTable (String TableName, String ColumnName, int from_ID, int to_ID) { - log.fine(TableName + "." + ColumnName + " - From=" + from_ID + ",To=" + to_ID); + if (log.isLoggable(Level.FINE)) log.fine(TableName + "." + ColumnName + " - From=" + from_ID + ",To=" + to_ID); String sql = "UPDATE " + TableName + " SET " + ColumnName + "=" + to_ID + " WHERE " + ColumnName + "=" + from_ID; @@ -228,7 +228,7 @@ public class Merge m_trx.rollback(); } - log.fine(count + if (log.isLoggable(Level.FINE)) log.fine(count + (delete ? " -Delete- " : " -Update- ") + TableName); diff --git a/org.adempiere.ui/src/org/compiere/apps/form/PaySelect.java b/org.adempiere.ui/src/org/compiere/apps/form/PaySelect.java index 50f5805887..b9327f53a6 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/PaySelect.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/PaySelect.java @@ -454,7 +454,7 @@ public class PaySelect { return Msg.translate(Env.getCtx(), "C_PaySelectionLine_ID"); } - log.fine("C_Invoice_ID=" + C_Invoice_ID + ", PayAmt=" + PayAmt); + if (log.isLoggable(Level.FINE)) log.fine("C_Invoice_ID=" + C_Invoice_ID + ", PayAmt=" + PayAmt); } } // for all rows in table diff --git a/org.adempiere.ui/src/org/compiere/apps/form/StatementCreateFromBatch.java b/org.adempiere.ui/src/org/compiere/apps/form/StatementCreateFromBatch.java index 615d3381d5..958367f875 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/StatementCreateFromBatch.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/StatementCreateFromBatch.java @@ -98,7 +98,7 @@ public abstract class StatementCreateFromBatch extends CreateFromForm sql.append(" AND TRUNC(p.DateTrx) BETWEEN ? AND ?"); } - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); return sql.toString(); } @@ -135,7 +135,7 @@ public abstract class StatementCreateFromBatch extends CreateFromForm { BigDecimal from = (BigDecimal) AmtFrom; BigDecimal to = (BigDecimal) AmtTo; - log.fine("Amt From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to); if(from == null && to != null) pstmt.setBigDecimal(index++, to); else if(from != null && to == null) @@ -151,7 +151,7 @@ public abstract class StatementCreateFromBatch extends CreateFromForm { Timestamp from = (Timestamp) DateFrom; Timestamp to = (Timestamp) DateTo; - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if(from == null && to != null) pstmt.setTimestamp(index++, to); else if(from != null && to == null) @@ -169,7 +169,7 @@ public abstract class StatementCreateFromBatch extends CreateFromForm String s = text.toUpperCase(); if(!s.endsWith("%")) s += "%"; - log.fine( "String=" + s); + if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); return s; } @@ -282,7 +282,7 @@ public abstract class StatementCreateFromBatch extends CreateFromForm pp = (KeyNamePair) miniTable.getValueAt(i, 5); // 5- C_BankAccount_ID int C_BankAccount_ID = pp.getKey(); - log.fine("Deposit Batch Date=" + trxDate + ", Batch=" + X_DepositBatch_ID + if (log.isLoggable(Level.FINE)) log.fine("Deposit Batch Date=" + trxDate + ", Batch=" + X_DepositBatch_ID +" , Bank Account" + C_BankAccount_ID); PreparedStatement pstmt = null; @@ -300,7 +300,7 @@ public abstract class StatementCreateFromBatch extends CreateFromForm int C_Currency_ID = rs.getInt(4); BigDecimal TrxAmt = rs.getBigDecimal(6); // PayAmt - log.fine("Line Date=" + trxDate + ", Payment=" + C_Payment_ID + ", Currency=" + C_Currency_ID + ", Amt=" + TrxAmt); + if (log.isLoggable(Level.FINE)) log.fine("Line Date=" + trxDate + ", Payment=" + C_Payment_ID + ", Currency=" + C_Currency_ID + ", Amt=" + TrxAmt); // MBankStatementLine bsl = new MBankStatementLine (bs); bsl.setStatementLineDate(trxDate); diff --git a/org.adempiere.ui/src/org/compiere/apps/form/TrxMaterial.java b/org.adempiere.ui/src/org/compiere/apps/form/TrxMaterial.java index 1d07c8dc94..111e8a95cf 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/TrxMaterial.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/TrxMaterial.java @@ -125,7 +125,7 @@ public class TrxMaterial { int lineID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "M_InOutLine_ID"); if (lineID != 0) { - log.fine("M_InOutLine_ID=" + lineID); + if (log.isLoggable(Level.FINE)) log.fine("M_InOutLine_ID=" + lineID); if (Env.getContext(Env.getCtx(), m_WindowNo, "MovementType").startsWith("C")) AD_Window_ID = WINDOW_SHIPMENT_CUSTOMER; // Customer else @@ -138,7 +138,7 @@ public class TrxMaterial { lineID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "M_InventoryLine_ID"); if (lineID != 0) { - log.fine("M_InventoryLine_ID=" + lineID); + if (log.isLoggable(Level.FINE)) log.fine("M_InventoryLine_ID=" + lineID); AD_Window_ID = WINDOW_PHYSICALINVENTORY; ColumnName = "M_Inventory_ID"; SQL = "SELECT M_Inventory_ID FROM M_InventoryLine WHERE M_InventoryLine_ID=?"; @@ -148,7 +148,7 @@ public class TrxMaterial { lineID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "M_MovementLine_ID"); if (lineID != 0) { - log.fine("M_MovementLine_ID=" + lineID); + if (log.isLoggable(Level.FINE)) log.fine("M_MovementLine_ID=" + lineID); AD_Window_ID = WINDOW_INVENTORYMOVE; ColumnName = "M_Movement_ID"; SQL = "SELECT M_Movement_ID FROM M_MovementLine WHERE M_MovementLine_ID=?"; @@ -158,13 +158,13 @@ public class TrxMaterial { lineID = Env.getContextAsInt(Env.getCtx(), m_WindowNo, "M_ProductionLine_ID"); if (lineID != 0) { - log.fine("M_ProductionLine_ID=" + lineID); + if (log.isLoggable(Level.FINE)) log.fine("M_ProductionLine_ID=" + lineID); AD_Window_ID = WINDOW_PRODUCTION; ColumnName = "M_Production_ID"; SQL = "SELECT M_Production_ID FROM M_ProductionLine WHERE M_ProductionLine_ID=?"; } else - log.fine("Not found WindowNo=" + m_WindowNo); + if (log.isLoggable(Level.FINE)) log.fine("Not found WindowNo=" + m_WindowNo); } } } diff --git a/org.adempiere.ui/src/org/compiere/grid/CreateFromBatch.java b/org.adempiere.ui/src/org/compiere/grid/CreateFromBatch.java index 544dbd2d04..eddc7cf373 100644 --- a/org.adempiere.ui/src/org/compiere/grid/CreateFromBatch.java +++ b/org.adempiere.ui/src/org/compiere/grid/CreateFromBatch.java @@ -19,6 +19,7 @@ import java.sql.SQLException; import java.sql.Timestamp; import java.text.DecimalFormat; import java.util.Vector; +import java.util.logging.Level; import org.compiere.apps.IStatusBar; import org.compiere.minigrid.IMiniTable; @@ -84,7 +85,7 @@ public abstract class CreateFromBatch extends CreateFrom sql.append(" AND TRUNC(p.DateTrx) BETWEEN ? AND ?"); } - log.fine(sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(sql.toString()); return sql.toString(); } @@ -121,7 +122,7 @@ public abstract class CreateFromBatch extends CreateFrom { BigDecimal from = (BigDecimal) AmtFrom; BigDecimal to = (BigDecimal) AmtTo; - log.fine("Amt From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Amt From=" + from + ", To=" + to); if(from == null && to != null) pstmt.setBigDecimal(index++, to); else if(from != null && to == null) @@ -137,7 +138,7 @@ public abstract class CreateFromBatch extends CreateFrom { Timestamp from = (Timestamp) DateFrom; Timestamp to = (Timestamp) DateTo; - log.fine("Date From=" + from + ", To=" + to); + if (log.isLoggable(Level.FINE)) log.fine("Date From=" + from + ", To=" + to); if(from == null && to != null) pstmt.setTimestamp(index++, to); else if(from != null && to == null) @@ -155,7 +156,7 @@ public abstract class CreateFromBatch extends CreateFrom String s = text.toUpperCase(); if(!s.endsWith("%")) s += "%"; - log.fine( "String=" + s); + if (log.isLoggable(Level.FINE)) log.fine( "String=" + s); return s; } diff --git a/org.adempiere.ui/src/org/compiere/grid/CreateFromDepositBatch.java b/org.adempiere.ui/src/org/compiere/grid/CreateFromDepositBatch.java index f94b4bde06..74e25bb0f2 100644 --- a/org.adempiere.ui/src/org/compiere/grid/CreateFromDepositBatch.java +++ b/org.adempiere.ui/src/org/compiere/grid/CreateFromDepositBatch.java @@ -140,7 +140,7 @@ public abstract class CreateFromDepositBatch extends CreateFromBatch BigDecimal TrxAmt = (BigDecimal) miniTable.getValueAt(i, 4); // 4-PayAmt // BigDecimal StmtAmt = (BigDecimal) miniTable.getValueAt(i, 5);// 5-Conv Amt // - log.fine("Line Date=" + trxDate + ", Payment=" + C_Payment_ID + ", Currency=" + C_Currency_ID + ", Amt=" + TrxAmt); + if (log.isLoggable(Level.FINE)) log.fine("Line Date=" + trxDate + ", Payment=" + C_Payment_ID + ", Currency=" + C_Currency_ID + ", Amt=" + TrxAmt); // MDepositBatchLine dbl = new MDepositBatchLine(db); // dbl.setStatementLineDate(trxDate); diff --git a/org.adempiere.ui/src/org/compiere/grid/CreateFromInvoice.java b/org.adempiere.ui/src/org/compiere/grid/CreateFromInvoice.java index d6b88488eb..a24fec9819 100644 --- a/org.adempiere.ui/src/org/compiere/grid/CreateFromInvoice.java +++ b/org.adempiere.ui/src/org/compiere/grid/CreateFromInvoice.java @@ -428,7 +428,7 @@ public abstract class CreateFromInvoice extends CreateFrom } QtyEntered = QtyEntered.setScale(precision, BigDecimal.ROUND_HALF_DOWN); // - log.fine("Line QtyEntered=" + QtyEntered + if (log.isLoggable(Level.FINE)) log.fine("Line QtyEntered=" + QtyEntered + ", Product_ID=" + M_Product_ID + ", OrderLine_ID=" + C_OrderLine_ID + ", InOutLine_ID=" + M_InOutLine_ID); @@ -468,7 +468,7 @@ public abstract class CreateFromInvoice extends CreateFrom String whereClause = "EXISTS (SELECT 1 FROM M_InOut io WHERE io.M_InOut_ID=M_InOutLine.M_InOut_ID AND io.DocStatus IN ('CO','CL'))"; MInOutLine[] lines = MInOutLine.getOfOrderLine(Env.getCtx(), C_OrderLine_ID, whereClause, trxName); - log.fine ("Receipt Lines with OrderLine = #" + lines.length); + if (log.isLoggable(Level.FINE)) log.fine ("Receipt Lines with OrderLine = #" + lines.length); if (lines.length > 0) { for (int j = 0; j < lines.length; j++) @@ -492,7 +492,7 @@ public abstract class CreateFromInvoice extends CreateFrom { String whereClause = "EXISTS (SELECT 1 FROM M_InOut io WHERE io.M_InOut_ID=M_InOutLine.M_InOut_ID AND io.DocStatus IN ('CO','CL'))"; MInOutLine[] lines = MInOutLine.getOfRMALine(Env.getCtx(), M_RMALine_ID, whereClause, null); - log.fine ("Receipt Lines with RMALine = #" + lines.length); + if (log.isLoggable(Level.FINE)) log.fine ("Receipt Lines with RMALine = #" + lines.length); if (lines.length > 0) { for (int j = 0; j < lines.length; j++) diff --git a/org.adempiere.ui/src/org/compiere/grid/CreateFromShipment.java b/org.adempiere.ui/src/org/compiere/grid/CreateFromShipment.java index ecc4ecf4ae..966c4b1734 100644 --- a/org.adempiere.ui/src/org/compiere/grid/CreateFromShipment.java +++ b/org.adempiere.ui/src/org/compiere/grid/CreateFromShipment.java @@ -594,7 +594,7 @@ public abstract class CreateFromShipment extends CreateFrom } QtyEntered = QtyEntered.setScale(precision, BigDecimal.ROUND_HALF_DOWN); // - log.fine("Line QtyEntered=" + QtyEntered + if (log.isLoggable(Level.FINE)) log.fine("Line QtyEntered=" + QtyEntered + ", Product=" + M_Product_ID + ", OrderLine=" + C_OrderLine_ID + ", InvoiceLine=" + C_InvoiceLine_ID); diff --git a/org.adempiere.ui/src/org/compiere/grid/CreateFromStatement.java b/org.adempiere.ui/src/org/compiere/grid/CreateFromStatement.java index a21fcec4aa..3d9aba336c 100644 --- a/org.adempiere.ui/src/org/compiere/grid/CreateFromStatement.java +++ b/org.adempiere.ui/src/org/compiere/grid/CreateFromStatement.java @@ -134,7 +134,7 @@ public abstract class CreateFromStatement extends CreateFromBatch int C_Currency_ID = pp.getKey(); BigDecimal TrxAmt = (BigDecimal) miniTable.getValueAt(i, 5); // 5- Conv Amt - log.fine("Line Date=" + trxDate + if (log.isLoggable(Level.FINE)) log.fine("Line Date=" + trxDate + ", Payment=" + C_Payment_ID + ", Currency=" + C_Currency_ID + ", Amt=" + TrxAmt); // MBankStatementLine bsl = new MBankStatementLine (bs); diff --git a/org.adempiere.ui/src/org/compiere/grid/PaymentFormCash.java b/org.adempiere.ui/src/org/compiere/grid/PaymentFormCash.java index d86fc19b35..579ea67100 100644 --- a/org.adempiere.ui/src/org/compiere/grid/PaymentFormCash.java +++ b/org.adempiere.ui/src/org/compiere/grid/PaymentFormCash.java @@ -226,9 +226,9 @@ public abstract class PaymentFormCash extends PaymentForm { */ if (!PAYMENTRULE.equals(m_PaymentRule)) { - log.fine("Changed PaymentRule: " + m_PaymentRule + " -> " + PAYMENTRULE); + if (log.isLoggable(Level.FINE)) log.fine("Changed PaymentRule: " + m_PaymentRule + " -> " + PAYMENTRULE); // We had a CashBook Entry - log.fine("Old Cash - " + m_cashLine); + if (log.isLoggable(Level.FINE)) log.fine("Old Cash - " + m_cashLine); if (m_cashLine != null) { MCashLine cl = m_cashLine.createReversal(); @@ -365,7 +365,7 @@ public abstract class PaymentFormCash extends PaymentForm { */ if (m_Cash_As_Payment) { - log.fine("Payment - " + PAYMENTRULE); + if (log.isLoggable(Level.FINE)) log.fine("Payment - " + PAYMENTRULE); // Set Amount m_mPayment.setAmount(m_C_Currency_ID, payAmount); // Get changes to cash amount @@ -396,7 +396,7 @@ public abstract class PaymentFormCash extends PaymentForm { } } else - log.fine("NotDraft " + m_mPayment); + if (log.isLoggable(Level.FINE)) log.fine("NotDraft " + m_mPayment); } /********************** diff --git a/org.adempiere.ui/src/org/compiere/grid/PaymentFormCheck.java b/org.adempiere.ui/src/org/compiere/grid/PaymentFormCheck.java index 594f9c87ec..16055d66c2 100644 --- a/org.adempiere.ui/src/org/compiere/grid/PaymentFormCheck.java +++ b/org.adempiere.ui/src/org/compiere/grid/PaymentFormCheck.java @@ -149,11 +149,11 @@ public abstract class PaymentFormCheck extends PaymentForm { */ if (!PAYMENTRULE.equals(m_PaymentRule)) { - log.fine("Changed PaymentRule: " + m_PaymentRule + " -> " + PAYMENTRULE); + if (log.isLoggable(Level.FINE)) log.fine("Changed PaymentRule: " + m_PaymentRule + " -> " + PAYMENTRULE); // We had a change in Payment type (e.g. Check to CC) if (payTypes.indexOf(m_PaymentRule) != -1 && payTypes.indexOf(PAYMENTRULE) != -1 && m_mPaymentOriginal != null) { - log.fine("Old Payment(1) - " + m_mPaymentOriginal); + if (log.isLoggable(Level.FINE)) log.fine("Old Payment(1) - " + m_mPaymentOriginal); m_mPaymentOriginal.setDocAction(DocAction.ACTION_Reverse_Correct); boolean ok = m_mPaymentOriginal.processIt(DocAction.ACTION_Reverse_Correct); m_mPaymentOriginal.saveEx(); @@ -169,7 +169,7 @@ public abstract class PaymentFormCheck extends PaymentForm { // We had a Payment and something else (e.g. Check to Cash) else if (payTypes.indexOf(m_PaymentRule) != -1 && payTypes.indexOf(PAYMENTRULE) == -1) { - log.fine("Old Payment(2) - " + m_mPaymentOriginal); + if (log.isLoggable(Level.FINE)) log.fine("Old Payment(2) - " + m_mPaymentOriginal); if (m_mPaymentOriginal != null) { m_mPaymentOriginal.setDocAction(DocAction.ACTION_Reverse_Correct); @@ -177,7 +177,7 @@ public abstract class PaymentFormCheck extends PaymentForm { m_mPaymentOriginal.saveEx(); if (ok) // Cancel Payment { - log.fine("PaymentCancelled " + m_mPayment.getDocumentNo ()); + if (log.isLoggable(Level.FINE)) log.fine("PaymentCancelled " + m_mPayment.getDocumentNo ()); getGridTab().getTableModel().dataSave(true); m_mPayment.resetNew(); m_mPayment.setAmount(m_C_Currency_ID, m_Amount); @@ -220,7 +220,7 @@ public abstract class PaymentFormCheck extends PaymentForm { /*********************** * Payments */ - log.fine("Payment - " + PAYMENTRULE); + if (log.isLoggable(Level.FINE)) log.fine("Payment - " + PAYMENTRULE); // Set Amount m_mPayment.setAmount(m_C_Currency_ID, payAmount); m_mPayment.setBankCheck(newC_BankAccount_ID, m_isSOTrx, routing, @@ -251,7 +251,7 @@ public abstract class PaymentFormCheck extends PaymentForm { } } else - log.fine("NotDraft " + m_mPayment); + if (log.isLoggable(Level.FINE)) log.fine("NotDraft " + m_mPayment); /********************** * Save Values to mTab diff --git a/org.adempiere.ui/src/org/compiere/grid/PaymentFormCreditCard.java b/org.adempiere.ui/src/org/compiere/grid/PaymentFormCreditCard.java index e313d2415e..0d5c194095 100644 --- a/org.adempiere.ui/src/org/compiere/grid/PaymentFormCreditCard.java +++ b/org.adempiere.ui/src/org/compiere/grid/PaymentFormCreditCard.java @@ -14,6 +14,7 @@ package org.compiere.grid; import java.math.BigDecimal; +import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; import org.adempiere.util.PaymentUtil; @@ -232,11 +233,11 @@ public abstract class PaymentFormCreditCard extends PaymentForm { */ if (!PAYMENTRULE.equals(m_PaymentRule)) { - log.fine("Changed PaymentRule: " + m_PaymentRule + " -> " + PAYMENTRULE); + if (log.isLoggable(Level.FINE)) log.fine("Changed PaymentRule: " + m_PaymentRule + " -> " + PAYMENTRULE); // We had a change in Payment type (e.g. Check to CC) if (payTypes.indexOf(m_PaymentRule) != -1 && payTypes.indexOf(PAYMENTRULE) != -1 && m_mPaymentOriginal != null) { - log.fine("Old Payment(1) - " + m_mPaymentOriginal); + if (log.isLoggable(Level.FINE)) log.fine("Old Payment(1) - " + m_mPaymentOriginal); m_mPaymentOriginal.setDocAction(DocAction.ACTION_Reverse_Correct); boolean ok = m_mPaymentOriginal.processIt(DocAction.ACTION_Reverse_Correct); m_mPaymentOriginal.saveEx(); @@ -252,7 +253,7 @@ public abstract class PaymentFormCreditCard extends PaymentForm { // We had a Payment and something else (e.g. Check to Cash) else if (payTypes.indexOf(m_PaymentRule) != -1 && payTypes.indexOf(PAYMENTRULE) == -1) { - log.fine("Old Payment(2) - " + m_mPaymentOriginal); + if (log.isLoggable(Level.FINE)) log.fine("Old Payment(2) - " + m_mPaymentOriginal); if (m_mPaymentOriginal != null) { m_mPaymentOriginal.setDocAction(DocAction.ACTION_Reverse_Correct); @@ -260,7 +261,7 @@ public abstract class PaymentFormCreditCard extends PaymentForm { m_mPaymentOriginal.saveEx(); if (ok) // Cancel Payment { - log.fine("PaymentCancelled " + m_mPayment.getDocumentNo ()); + if (log.isLoggable(Level.FINE)) log.fine("PaymentCancelled " + m_mPayment.getDocumentNo ()); getGridTab().getTableModel().dataSave(true); m_mPayment.resetNew(); m_mPayment.setAmount(m_C_Currency_ID, m_Amount); @@ -303,7 +304,7 @@ public abstract class PaymentFormCreditCard extends PaymentForm { /*********************** * Payments */ - log.fine("Payment - " + PAYMENTRULE); + if (log.isLoggable(Level.FINE)) log.fine("Payment - " + PAYMENTRULE); // Set Amount m_mPayment.setAmount(m_C_Currency_ID, payAmount); m_mPayment.setCreditCard(MPayment.TRXTYPE_Sales, newCCType, newCCNumber, "", newCCExp); @@ -370,7 +371,7 @@ public abstract class PaymentFormCreditCard extends PaymentForm { } else { - log.fine("NotDraft " + m_mPayment); + if (log.isLoggable(Level.FINE)) log.fine("NotDraft " + m_mPayment); m_mPayment.setCreditCardNumber(PaymentUtil.encrpytCreditCard(m_mPayment.getCreditCardNumber())); m_mPayment.setCreditCardVV(PaymentUtil.encrpytCvv(m_mPayment.getCreditCardVV())); m_mPayment.saveEx(); diff --git a/org.adempiere.ui/src/org/compiere/grid/PaymentFormDirect.java b/org.adempiere.ui/src/org/compiere/grid/PaymentFormDirect.java index 7f4a418549..581ee96fb8 100644 --- a/org.adempiere.ui/src/org/compiere/grid/PaymentFormDirect.java +++ b/org.adempiere.ui/src/org/compiere/grid/PaymentFormDirect.java @@ -139,11 +139,11 @@ public abstract class PaymentFormDirect extends PaymentForm { */ if (!PAYMENTRULE.equals(m_PaymentRule)) { - log.fine("Changed PaymentRule: " + m_PaymentRule + " -> " + PAYMENTRULE); + if (log.isLoggable(Level.FINE)) log.fine("Changed PaymentRule: " + m_PaymentRule + " -> " + PAYMENTRULE); // We had a change in Payment type (e.g. Check to CC) if (payTypes.indexOf(m_PaymentRule) != -1 && payTypes.indexOf(PAYMENTRULE) != -1 && m_mPaymentOriginal != null) { - log.fine("Old Payment(1) - " + m_mPaymentOriginal); + if (log.isLoggable(Level.FINE)) log.fine("Old Payment(1) - " + m_mPaymentOriginal); m_mPaymentOriginal.setDocAction(DocAction.ACTION_Reverse_Correct); boolean ok = m_mPaymentOriginal.processIt(DocAction.ACTION_Reverse_Correct); m_mPaymentOriginal.saveEx(); @@ -159,7 +159,7 @@ public abstract class PaymentFormDirect extends PaymentForm { // We had a Payment and something else (e.g. Check to Cash) else if (payTypes.indexOf(m_PaymentRule) != -1 && payTypes.indexOf(PAYMENTRULE) == -1) { - log.fine("Old Payment(2) - " + m_mPaymentOriginal); + if (log.isLoggable(Level.FINE)) log.fine("Old Payment(2) - " + m_mPaymentOriginal); if (m_mPaymentOriginal != null) { m_mPaymentOriginal.setDocAction(DocAction.ACTION_Reverse_Correct); @@ -167,7 +167,7 @@ public abstract class PaymentFormDirect extends PaymentForm { m_mPaymentOriginal.saveEx(); if (ok) // Cancel Payment { - log.fine("PaymentCancelled " + m_mPayment.getDocumentNo ()); + if (log.isLoggable(Level.FINE)) log.fine("PaymentCancelled " + m_mPayment.getDocumentNo ()); getGridTab().getTableModel().dataSave(true); m_mPayment.resetNew(); m_mPayment.setAmount(m_C_Currency_ID, m_Amount); @@ -239,7 +239,7 @@ public abstract class PaymentFormDirect extends PaymentForm { } } else - log.fine("NotDraft " + m_mPayment); + if (log.isLoggable(Level.FINE)) log.fine("NotDraft " + m_mPayment); /********************** * Save Values to mTab diff --git a/org.adempiere.ui/src/org/compiere/install/TranslationHandler.java b/org.adempiere.ui/src/org/compiere/install/TranslationHandler.java index 257d49c86a..22870f688c 100644 --- a/org.adempiere.ui/src/org/compiere/install/TranslationHandler.java +++ b/org.adempiere.ui/src/org/compiere/install/TranslationHandler.java @@ -17,8 +17,8 @@ package org.compiere.install; import java.sql.Timestamp; +import java.util.logging.Level; -import org.compiere.util.CLogMgt; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Language; @@ -92,7 +92,7 @@ public class TranslationHandler extends DefaultHandler if (!m_isBaseLanguage) m_updateSQL += "_Trl"; m_updateSQL += " SET "; - log.fine("AD_Language=" + m_AD_Language + ", Base=" + m_isBaseLanguage + ", TableName=" + m_TableName); + if (log.isLoggable(Level.FINE)) log.fine("AD_Language=" + m_AD_Language + ", Base=" + m_isBaseLanguage + ", TableName=" + m_TableName); } else if (qName.equals(Translation.XML_ROW_TAG)) { @@ -167,8 +167,7 @@ public class TranslationHandler extends DefaultHandler int no = DB.executeUpdate(m_sql.toString(), null); if (no == 1) { - if (CLogMgt.isLevelFinest()) - log.fine(m_sql.toString()); + if (log.isLoggable(Level.FINE)) log.fine(m_sql.toString()); m_updateCount++; } else if (no == 0) diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/AssetServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/AssetServlet.java index 240c9d6cf6..f2f504c8b5 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/AssetServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/AssetServlet.java @@ -176,7 +176,7 @@ public class AssetServlet extends HttpServlet MAsset asset = new MAsset(ctx, A_Asset_ID, null); if (asset.getA_Asset_ID() != A_Asset_ID) { - log.fine("Asset not found - ID=" + A_Asset_ID); + if (log.isLoggable(Level.FINE)) log.fine("Asset not found - ID=" + A_Asset_ID); return "Asset not found"; } // Get WebUser & Compare with invoice @@ -215,7 +215,7 @@ public class AssetServlet extends HttpServlet } } } - log.fine(dl_name + " - " + dl_url); + if (log.isLoggable(Level.FINE)) log.fine(dl_name + " - " + dl_url); if (dl_name == null || dl_url == null || in == null) return "@NotFound@ @A_Asset_ID@: " + pd; @@ -257,7 +257,7 @@ public class AssetServlet extends HttpServlet int bufferSize = 2048; // 2k Buffer response.setBufferSize(bufferSize); // - log.fine(in + ", available=" + in.available()); + if (log.isLoggable(Level.FINE)) log.fine(in + ", available=" + in.available()); long time = System.currentTimeMillis(); // Zip Output Stream diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/BasketServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/BasketServlet.java index 592708117c..b6ea42d624 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/BasketServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/BasketServlet.java @@ -120,7 +120,7 @@ public class BasketServlet extends HttpServlet if (SalesRep_ID != 0) { wb.setSalesRep_ID(SalesRep_ID); - log.fine("SalesRep_ID=" + SalesRep_ID); + if (log.isLoggable(Level.FINE)) log.fine("SalesRep_ID=" + SalesRep_ID); } // Get Price List @@ -130,7 +130,7 @@ public class BasketServlet extends HttpServlet log.fine("No Price List in session"); pl = (PriceList)request.getAttribute(PriceList.NAME); } - log.fine("PL=" + pl); + if (log.isLoggable(Level.FINE)) log.fine("PL=" + pl); // Do we delete? Delete_x deleteLine (request, wb); @@ -179,14 +179,14 @@ public class BasketServlet extends HttpServlet try { M_Product_ID = Integer.parseInt (parameter.substring (4)); - log.fine("Found Parameter=" + parameter + " -> " + M_Product_ID); + if (log.isLoggable(Level.FINE)) log.fine("Found Parameter=" + parameter + " -> " + M_Product_ID); if (!WebUtil.exists(sQuantity)) sQuantity = WebUtil.getParameter (request, "Qty_" + M_Product_ID); if (!WebUtil.exists(sPrice)) sPrice = WebUtil.getParameter (request, "Price_" + M_Product_ID); if (!WebUtil.exists(Name)) Name = WebUtil.getParameter (request, "Name_" + M_Product_ID); - log.fine("Found Parameters " + Name + ",Qty=" + sQuantity + ",Price=" + sPrice); + if (log.isLoggable(Level.FINE)) log.fine("Found Parameters " + Name + ",Qty=" + sQuantity + ",Price=" + sPrice); } catch (Exception ex) { @@ -222,7 +222,7 @@ public class BasketServlet extends HttpServlet { Price = plp.getPrice (); Name = plp.getName (); - log.fine("Found in PL = " + Name + " - " + Price); + if (log.isLoggable(Level.FINE)) log.fine("Found in PL = " + Name + " - " + Price); } } /** if not found inPL and exists as parameter @@ -248,7 +248,7 @@ public class BasketServlet extends HttpServlet { Price = plp.getPrice (); Name = plp.getName (); - log.fine("Found in complete PL = " + Name + " - " + Price); + if (log.isLoggable(Level.FINE)) log.fine("Found in complete PL = " + Name + " - " + Price); } } @@ -256,7 +256,7 @@ public class BasketServlet extends HttpServlet if (Price != null) { WebBasketLine wbl = wb.add (M_Product_ID, Name, Qty, Price); - log.fine(wbl.toString()); + if (log.isLoggable(Level.FINE)) log.fine(wbl.toString()); } else // Price not found log.warning ("Product Price not found - M_Product_ID=" + M_Product_ID @@ -291,7 +291,7 @@ public class BasketServlet extends HttpServlet try { int line = Integer.parseInt (parameter.substring (7)); - log.fine("Delete parameter=" + parameter + " -> " + line); + if (log.isLoggable(Level.FINE)) log.fine("Delete parameter=" + parameter + " -> " + line); wb.delete(line); } catch (NumberFormatException ex) diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/CheckOutLinkTag.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/CheckOutLinkTag.java index 3ca13c3c39..cd76898286 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/CheckOutLinkTag.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/CheckOutLinkTag.java @@ -16,6 +16,7 @@ *****************************************************************************/ package org.compiere.wstore; import java.util.ArrayList; +import java.util.logging.Level; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @@ -74,7 +75,7 @@ public class CheckOutLinkTag extends TagSupport // log.fine("WebBasket=" + wb); if (wb != null && wb.getLineCount() > 0) { - log.fine("WebBasket exists"); + if (log.isLoggable(Level.FINE)) log.fine("WebBasket exists"); // JspWriter out = pageContext.getOut(); HtmlCode html = new HtmlCode(); diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/Click.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/Click.java index c4c54918ad..61ca7e48db 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/Click.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/Click.java @@ -19,6 +19,7 @@ package org.compiere.wstore; import java.io.IOException; import java.util.Enumeration; import java.util.Properties; +import java.util.logging.Level; import javax.servlet.ServletConfig; import javax.servlet.ServletException; @@ -113,12 +114,12 @@ public class Click extends HttpServlet if (!response.isCommitted ()) response.sendRedirect(url); response.flushBuffer(); - log.fine("redirect - " + url); + if (log.isLoggable(Level.FINE)) log.fine("redirect - " + url); // Save Click saveClick(request, url); // - log.fine(url + " - " + (System.currentTimeMillis()-time) + "ms"); + if (log.isLoggable(Level.FINE)) log.fine(url + " - " + (System.currentTimeMillis()-time) + "ms"); } // doGet /** diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/InfoLinkTag.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/InfoLinkTag.java index b533f89ff6..97117402d4 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/InfoLinkTag.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/InfoLinkTag.java @@ -17,6 +17,7 @@ package org.compiere.wstore; import java.util.Properties; +import java.util.logging.Level; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @@ -105,7 +106,7 @@ public class InfoLinkTag extends TagSupport } else { - if (CLogMgt.isLevelFiner()) + if (log.isLoggable(Level.FINE)) log.fine("No WebUser"); if (session.getAttribute(WebInfo.NAME) == null) session.setAttribute (WebInfo.NAME, WebInfo.getGeneral()); diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/InfoServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/InfoServlet.java index 9338a9cb7f..21d15cd401 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/InfoServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/InfoServlet.java @@ -149,7 +149,7 @@ public class InfoServlet extends HttpServlet // contact = -1 int AD_User_ID = WebUtil.getParameterAsInt(request, "contact"); // - log.fine("Subscribe=" + subscribe + if (log.isLoggable(Level.FINE)) log.fine("Subscribe=" + subscribe + ",R_InterestArea_ID=" + R_InterestArea_ID + ",AD_User_ID=" + AD_User_ID); if (R_InterestArea_ID == 0 || AD_User_ID == 0) diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/InvoiceServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/InvoiceServlet.java index 7750d25d71..c945417593 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/InvoiceServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/InvoiceServlet.java @@ -170,7 +170,7 @@ public class InvoiceServlet extends HttpServlet MInvoice invoice = new MInvoice (ctx, C_Invoice_ID, null); if (invoice.getC_Invoice_ID() != C_Invoice_ID) { - log.fine("Invoice not found - ID=" + C_Invoice_ID); + if (log.isLoggable(Level.FINE)) log.fine("Invoice not found - ID=" + C_Invoice_ID); return "Invoice not found"; } // Get WebUser & Compare with invoice @@ -230,7 +230,7 @@ public class InvoiceServlet extends HttpServlet response.setBufferSize(bufferSize); response.setContentLength(fileLength); // - log.fine(file.getAbsolutePath() + ", length=" + fileLength); + if (log.isLoggable(Level.FINE)) log.fine(file.getAbsolutePath() + ", length=" + fileLength); long time = System.currentTimeMillis(); // timer start // FileInputStream in = new FileInputStream (file); @@ -253,7 +253,7 @@ public class InvoiceServlet extends HttpServlet in.close(); time = System.currentTimeMillis() - time; double speed = (totalSize/1024) / ((double)time/1000); - log.fine("Length=" + if (log.isLoggable(Level.FINE)) log.fine("Length=" + totalSize + " - " + time + " ms - " + speed + " kB/sec"); diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/LocationTag.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/LocationTag.java index d991cf4285..9e2aa0d7ed 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/LocationTag.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/LocationTag.java @@ -260,7 +260,7 @@ public class LocationTag extends TagSupport - log.fine("C_Country_ID=" + C_Country_ID + ", C_Region_ID=" + C_Region_ID + if (log.isLoggable(Level.FINE)) log.fine("C_Country_ID=" + C_Country_ID + ", C_Region_ID=" + C_Region_ID + ", RegionName=" + regionName + ", City=" + city + ", Postal=" + postal); JspWriter out = pageContext.getOut(); diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/LoginServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/LoginServlet.java index 2f4b4f107c..3bc9650a69 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/LoginServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/LoginServlet.java @@ -18,6 +18,7 @@ package org.compiere.wstore; import java.io.IOException; import java.util.Properties; +import java.util.logging.Level; import javax.servlet.RequestDispatcher; import javax.servlet.ServletConfig; @@ -184,7 +185,7 @@ public class LoginServlet extends HttpServlet url += "?SalesRep_ID=" + salesRep; // //String mode = WebUtil.getParameter (request, "Mode"); - log.fine("- targeting url=" + url); // + " - mode=" + mode); + if (log.isLoggable(Level.FINE)) log.fine("- targeting url=" + url); // + " - mode=" + mode); // Web User WebUser wu = WebUser.get(request); diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/MessageTag.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/MessageTag.java index 4fe88c6fda..45041caf4c 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/MessageTag.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/MessageTag.java @@ -17,6 +17,7 @@ package org.compiere.wstore; import java.util.Properties; +import java.util.logging.Level; import javax.servlet.http.HttpServletRequest; import javax.servlet.jsp.JspException; @@ -65,7 +66,7 @@ public class MessageTag extends TagSupport { Properties ctx = JSPEnv.getCtx((HttpServletRequest)pageContext.getRequest()); String msg = Msg.translate(ctx, m_txt); - log.fine(m_txt + "->" + msg); + if (log.isLoggable(Level.FINE)) log.fine(m_txt + "->" + msg); // try { diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/NoteServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/NoteServlet.java index fa28bd64a5..597af8f094 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/NoteServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/NoteServlet.java @@ -18,6 +18,7 @@ package org.compiere.wstore; import java.io.IOException; import java.util.Properties; +import java.util.logging.Level; import javax.servlet.RequestDispatcher; import javax.servlet.ServletConfig; @@ -156,14 +157,14 @@ public class NoteServlet extends HttpServlet MNote doc = new MNote (ctx, AD_Note_ID, null); if (doc.getAD_Note_ID() != AD_Note_ID) { - log.fine("Note not found - ID=" + AD_Note_ID); + if (log.isLoggable(Level.FINE)) log.fine("Note not found - ID=" + AD_Note_ID); return "Notice not found"; } MAttachment attachment = doc.getAttachment(false); if (attachment == null) { - log.fine("No Attachment for AD_Note_ID=" + AD_Note_ID); + if (log.isLoggable(Level.FINE)) log.fine("No Attachment for AD_Note_ID=" + AD_Note_ID); return "Notice Attachment not found"; } @@ -221,7 +222,7 @@ public class NoteServlet extends HttpServlet { note.setProcessed(true); note.saveEx(); - log.fine("doPost - " + note); + if (log.isLoggable(Level.FINE)) log.fine("doPost - " + note); } } diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/OrderServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/OrderServlet.java index bd34cf92ab..47e69809e3 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/OrderServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/OrderServlet.java @@ -18,6 +18,7 @@ package org.compiere.wstore; import java.io.IOException; import java.util.Properties; +import java.util.logging.Level; import javax.servlet.RequestDispatcher; import javax.servlet.ServletConfig; @@ -257,7 +258,7 @@ public class OrderServlet extends HttpServlet if (C_Order_ID == 0) return null; - log.fine("C_Order_ID=" + C_Order_ID); + if (log.isLoggable(Level.FINE)) log.fine("C_Order_ID=" + C_Order_ID); return new MOrder (ctx, C_Order_ID, null); } // getOrder @@ -285,7 +286,7 @@ public class OrderServlet extends HttpServlet } // We have a Order No & DocAction - log.fine("DocAction=" + DocAction); + if (log.isLoggable(Level.FINE)) log.fine("DocAction=" + DocAction); if (!MOrder.DOCACTION_Void.equals(DocAction)) { // Do not complete Prepayment diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/PaymentServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/PaymentServlet.java index 137e5b6c0b..1e851dcdad 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/PaymentServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/PaymentServlet.java @@ -19,6 +19,7 @@ package org.compiere.wstore; import java.io.IOException; import java.math.BigDecimal; import java.util.Properties; +import java.util.logging.Level; import javax.servlet.RequestDispatcher; import javax.servlet.ServletConfig; @@ -286,7 +287,7 @@ public class PaymentServlet extends HttpServlet } else { - log.fine(payment.getErrorMessage()); + if (log.isLoggable(Level.FINE)) log.fine(payment.getErrorMessage()); String errMsg = payment.getErrorMessage(); payment.save (); payment.setErrorMessage(errMsg); diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/PriceList.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/PriceList.java index 44aff45f98..f89baf8c7a 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/PriceList.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/PriceList.java @@ -328,7 +328,7 @@ public class PriceList DB.close(rs, pstmt); rs = null; pstmt = null; } - log.fine("load #" + m_prices.size() + ", Search=" + m_searchInfo); + if (log.isLoggable(Level.FINE)) log.fine("load #" + m_prices.size() + ", Search=" + m_searchInfo); } // load diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/PriceListTag.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/PriceListTag.java index ec5773e62e..c9fa5ab0b2 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/PriceListTag.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/PriceListTag.java @@ -17,6 +17,7 @@ package org.compiere.wstore; import java.util.Properties; +import java.util.logging.Level; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @@ -92,7 +93,7 @@ public class PriceListTag extends TagSupport int PriceList_ID = wu.getM_PriceList_ID(); if (PriceList_ID != 0) { - log.fine("- using BP PriceList_ID=" + PriceList_ID); + if (log.isLoggable(Level.FINE)) log.fine("- using BP PriceList_ID=" + PriceList_ID); M_PriceList_ID = PriceList_ID; } } @@ -111,7 +112,7 @@ public class PriceListTag extends TagSupport // Set Price List HttpSession session = pageContext.getSession(); session.setAttribute (PriceList.NAME, m_priceList); - log.fine("PL=" + m_priceList); + if (log.isLoggable(Level.FINE)) log.fine("PL=" + m_priceList); // Set Locale from Price List String AD_Language = m_priceList.getAD_Language(); diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/ProductCategoryListTag.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/ProductCategoryListTag.java index f30fcb5075..7f38e83579 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/ProductCategoryListTag.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/ProductCategoryListTag.java @@ -17,6 +17,7 @@ package org.compiere.wstore; import java.util.Properties; +import java.util.logging.Level; import javax.servlet.http.HttpServletRequest; import javax.servlet.jsp.JspException; @@ -69,7 +70,7 @@ public class ProductCategoryListTag extends TagSupport select sel = new select (name, options); sel.setID("ID_" + name); - log.fine("AD_Client_ID=" + AD_Client_ID + ", #=" + options.length); + if (log.isLoggable(Level.FINE)) log.fine("AD_Client_ID=" + AD_Client_ID + ", #=" + options.length); // Assemble HtmlCode html = new HtmlCode(); diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestOrderRefTag.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestOrderRefTag.java index fa04736242..3828a6c6a5 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestOrderRefTag.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestOrderRefTag.java @@ -152,7 +152,7 @@ public class RequestOrderRefTag extends TagSupport // Return to Array and return option options[] = new option [list.size()]; list.toArray(options); - log.fine("#" + options.length); + if (log.isLoggable(Level.FINE)) log.fine("#" + options.length); return options; } // getOptions diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestServlet.java index be2e10b166..ffb3424c4a 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestServlet.java @@ -175,14 +175,14 @@ public class RequestServlet extends HttpServlet MRequest doc = new MRequest (ctx, R_Request_ID, null); if (doc.getR_Request_ID() != R_Request_ID) { - log.fine("Request not found - R_Request_ID=" + R_Request_ID); + if (log.isLoggable(Level.FINE)) log.fine("Request not found - R_Request_ID=" + R_Request_ID); return "Request not found"; } MAttachment attachment = doc.getAttachment(false); if (attachment == null) { - log.fine("No Attachment for R_Request_ID=" + R_Request_ID); + if (log.isLoggable(Level.FINE)) log.fine("No Attachment for R_Request_ID=" + R_Request_ID); return "Request Attachment not found"; } @@ -246,7 +246,7 @@ public class RequestServlet extends HttpServlet String source = WebUtil.getParameter (request, P_SOURCE); String info = WebUtil.getParameter (request, P_INFO); String forwardTo = WebUtil.getParameter (request, P_FORWARDTO); - log.fine("Referer=" + requestRef + ", Source=" + source + ", ForwardTo=" + forwardTo); + if (log.isLoggable(Level.FINE)) log.fine("Referer=" + requestRef + ", Source=" + source + ", ForwardTo=" + forwardTo); if (requestURL == null) requestURL = ""; if (requestURL.equals(requestRef)) // if URL and Referrer are the same, get source @@ -409,7 +409,7 @@ public class RequestServlet extends HttpServlet return; } String fileName = upload.getFileName(); - log.fine("R_Request_ID=" + R_Request_ID + " - " + fileName); + if (log.isLoggable(Level.FINE)) log.fine("R_Request_ID=" + R_Request_ID + " - " + fileName); // Add Attachment MAttachment attachment = req.createAttachment(); @@ -423,7 +423,7 @@ public class RequestServlet extends HttpServlet } else WebUtil.createForwardPage(response, "File Upload Error - Please try again", "requests.jsp", 10); - log.fine(attachment.toString()); + if (log.isLoggable(Level.FINE)) log.fine(attachment.toString()); } // uploadFile diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestTypeTag.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestTypeTag.java index 18946d096a..36783b475e 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestTypeTag.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/RequestTypeTag.java @@ -120,7 +120,7 @@ public class RequestTypeTag extends TagSupport // Return to Array and return option options[] = new option [list.size()]; list.toArray(options); - log.fine("#" + options.length); + if (log.isLoggable(Level.FINE)) log.fine("#" + options.length); return options; } // getOptions diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/RfQServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/RfQServlet.java index 87a0de7861..f798d141b7 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/RfQServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/RfQServlet.java @@ -153,7 +153,7 @@ public class RfQServlet extends HttpServlet MRfQ doc = new MRfQ (ctx, C_RfQ_ID, null); if (doc.getC_RfQ_ID() != C_RfQ_ID) { - log.fine("streamAttachment - RfQ not found - ID=" + C_RfQ_ID); + if (log.isLoggable(Level.FINE)) log.fine("streamAttachment - RfQ not found - ID=" + C_RfQ_ID); return "RfQ not found"; } @@ -173,7 +173,7 @@ public class RfQServlet extends HttpServlet response.setBufferSize(bufferSize); response.setContentLength(fileLength); // - log.fine("streamAttachment - length=" + fileLength); + if (log.isLoggable(Level.FINE)) log.fine("streamAttachment - length=" + fileLength); long time = System.currentTimeMillis(); // timer start // ServletOutputStream out = response.getOutputStream (); @@ -183,7 +183,7 @@ public class RfQServlet extends HttpServlet // time = System.currentTimeMillis() - time; double speed = (fileLength/(double)1024) / (time/(double)1000); - log.fine("streamInvoice - length=" + if (log.isLoggable(Level.FINE)) log.fine("streamInvoice - length=" + fileLength + " - " + time + " ms - " + speed + " kB/sec"); @@ -257,7 +257,7 @@ public class RfQServlet extends HttpServlet */ private String updateResponse (HttpServletRequest request, MRfQResponse rfqResponse) { - log.fine("updateResponse - " + rfqResponse); + if (log.isLoggable(Level.FINE)) log.fine("updateResponse - " + rfqResponse); String saveError = "RfQ NOT updated"; String msg = "RfQ updated"; // RfQ Response @@ -311,7 +311,7 @@ public class RfQServlet extends HttpServlet return saveError; } } - log.fine("complete - " + rfqResponse); + if (log.isLoggable(Level.FINE)) log.fine("complete - " + rfqResponse); return msg; } // updateResponse diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/WebOrder.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/WebOrder.java index ad4346a2b4..d7b53df857 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/WebOrder.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/WebOrder.java @@ -19,6 +19,7 @@ package org.compiere.wstore; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Properties; +import java.util.logging.Level; import org.compiere.model.MCurrency; import org.compiere.model.MInvoice; @@ -77,7 +78,7 @@ public class WebOrder private boolean createOrder (WebUser wu, WebBasket wb) { m_order = new MOrder (m_ctx, 0, null); - log.fine("AD_Client_ID=" + m_order.getAD_Client_ID() + if (log.isLoggable(Level.FINE)) log.fine("AD_Client_ID=" + m_order.getAD_Client_ID() + ",AD_Org_ID=" + m_order.getAD_Org_ID() + " - " + m_order); // m_order.setC_DocTypeTarget_ID(MOrder.DocSubTypeSO_Prepay); @@ -98,7 +99,7 @@ public class WebOrder m_order.setSendEMail(true); m_order.setDocAction(MOrder.DOCACTION_Prepare); m_order.saveEx(); - log.fine("ID=" + m_order.getC_Order_ID() + if (log.isLoggable(Level.FINE)) log.fine("ID=" + m_order.getC_Order_ID() + ", DocNo=" + m_order.getDocumentNo()); ArrayList lines = wb.getLines(); diff --git a/org.adempiere.webstore.servlet/src/org/compiere/wstore/WorkflowServlet.java b/org.adempiere.webstore.servlet/src/org/compiere/wstore/WorkflowServlet.java index 12142ccc91..dae0d9811e 100644 --- a/org.adempiere.webstore.servlet/src/org/compiere/wstore/WorkflowServlet.java +++ b/org.adempiere.webstore.servlet/src/org/compiere/wstore/WorkflowServlet.java @@ -18,6 +18,7 @@ package org.compiere.wstore; import java.io.IOException; import java.util.Properties; +import java.util.logging.Level; import javax.servlet.RequestDispatcher; import javax.servlet.ServletConfig; @@ -157,14 +158,14 @@ public class WorkflowServlet extends HttpServlet MWFActivity doc = new MWFActivity (ctx, AD_WF_Activity_ID, null); if (doc.get_ID() != AD_WF_Activity_ID) { - log.fine("streamAttachment - Activity not found - ID=" + AD_WF_Activity_ID); + if (log.isLoggable(Level.FINE)) log.fine("streamAttachment - Activity not found - ID=" + AD_WF_Activity_ID); return "Activity not found"; } MAttachment attachment = doc.getAttachment(false); if (attachment == null) { - log.fine("streamAttachment - No Attachment for AD_WF_Activity_ID=" + AD_WF_Activity_ID); + if (log.isLoggable(Level.FINE)) log.fine("streamAttachment - No Attachment for AD_WF_Activity_ID=" + AD_WF_Activity_ID); return "Notice Attachment not found"; } @@ -222,10 +223,10 @@ public class WorkflowServlet extends HttpServlet boolean isApproved = WebUtil.getParameterAsBoolean (request, "IsApproved"); boolean isRejected = WebUtil.getParameterAsBoolean (request, "IsApproved"); String textMsg = WebUtil.getParameter (request, "textMsg"); - log.fine("doPost - TextMsg=" + textMsg); + if (log.isLoggable(Level.FINE)) log.fine("doPost - TextMsg=" + textMsg); // MWFActivity act = new MWFActivity (ctx, AD_WF_Activity_ID, null); - log.fine("doPost - " + act); + if (log.isLoggable(Level.FINE)) log.fine("doPost - " + act); if (AD_WF_Activity_ID == 0 || act == null || act.getAD_WF_Activity_ID() != AD_WF_Activity_ID) session.setAttribute(WebSessionCtx.HDR_MESSAGE, "Activity not found"); diff --git a/org.compiere.db.oracle.provider/src/org/adempiere/db/oracle/config/ConfigOracle.java b/org.compiere.db.oracle.provider/src/org/adempiere/db/oracle/config/ConfigOracle.java index b05efd612b..b26ec4aba4 100644 --- a/org.compiere.db.oracle.provider/src/org/adempiere/db/oracle/config/ConfigOracle.java +++ b/org.compiere.db.oracle.provider/src/org/adempiere/db/oracle/config/ConfigOracle.java @@ -463,7 +463,7 @@ public class ConfigOracle implements IDatabaseConfig */ private boolean testJDBC (String url, String uid, String pwd) { - log.fine("Url=" + url + ", UID=" + uid); + if (log.isLoggable(Level.FINE)) log.fine("Url=" + url + ", UID=" + uid); try { DriverManager.registerDriver(Database.getDatabase(Database.DB_ORACLE).getDriver()); diff --git a/org.idempiere.fitnesse.fixture/src/org/idempiere/fitnesse/fixture/RunProcess.java b/org.idempiere.fitnesse.fixture/src/org/idempiere/fitnesse/fixture/RunProcess.java index 90b582f69a..359174500a 100644 --- a/org.idempiere.fitnesse.fixture/src/org/idempiere/fitnesse/fixture/RunProcess.java +++ b/org.idempiere.fitnesse.fixture/src/org/idempiere/fitnesse/fixture/RunProcess.java @@ -31,6 +31,7 @@ import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.Properties; +import java.util.logging.Level; import org.compiere.model.Lookup; import org.compiere.model.MPInstance; @@ -275,7 +276,7 @@ public class RunProcess extends TableFixture { if (ob!=null) valueString2 = ob.toString(); } - log.fine("fillParameter - " + key + " = " + valueString); + if (log.isLoggable(Level.FINE)) log.fine("fillParameter - " + key + " = " + valueString); Object value = valueString; if (valueString != null && valueString.length() == 0) value = null; @@ -305,7 +306,7 @@ public class RunProcess extends TableFixture { else bd = new BigDecimal (value.toString()); iPara.setP_Number(bd); - log.fine("fillParameter - " + key + if (log.isLoggable(Level.FINE)) log.fine("fillParameter - " + key + " = " + valueString + " (=" + bd + "=)"); if (pPara.isRange()) @@ -347,7 +348,7 @@ public class RunProcess extends TableFixture { } - log.fine("fillParameter - " + key + if (log.isLoggable(Level.FINE)) log.fine("fillParameter - " + key + " = " + valueString + " (=" + ts + "=)"); } else if (DisplayType.YesNo == pPara.getAD_Reference_ID()) diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/Process.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/Process.java index c968c92573..c421708295 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/Process.java +++ b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/Process.java @@ -428,7 +428,7 @@ public class Process { if (ob!=null) valueString2 = ob.toString(); } - log.fine("fillParameter - " + key + " = " + valueString); + if (log.isLoggable(Level.FINE)) log.fine("fillParameter - " + key + " = " + valueString); Object value = valueString; if (valueString != null && valueString.length() == 0) value = null; @@ -458,7 +458,7 @@ public class Process { else bd = new BigDecimal (value.toString()); iPara.setP_Number(bd); - log.fine("fillParameter - " + key + if (log.isLoggable(Level.FINE)) log.fine("fillParameter - " + key + " = " + valueString + " (=" + bd + "=)"); if (pPara.isRange()) @@ -498,7 +498,7 @@ public class Process { } - log.fine("fillParameter - " + key + if (log.isLoggable(Level.FINE)) log.fine("fillParameter - " + key + " = " + valueString + " (=" + ts + "=)"); } else if (DisplayType.YesNo == pPara.getAD_Reference_ID())