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

This commit is contained in:
Richard Morales 2013-02-22 15:50:25 -05:00
parent b5102829f1
commit 7c53aa5f4d
37 changed files with 98 additions and 94 deletions

View File

@ -174,7 +174,7 @@ public class DocumentTypeVerify extends SvrProcess
if (pc.save())
{
counter++;
s_log.fine(pc.toString());
if (s_log.isLoggable(Level.FINE)) s_log.fine(pc.toString());
}
else
s_log.warning("Not saved: " + pc);

View File

@ -147,7 +147,7 @@ public class SequenceCheck extends SvrProcess
sp.addLog(0, null, null,msglog.toString());
}
else
s_log.fine("Sync #" + no);
if (s_log.isLoggable(Level.FINE)) s_log.fine("Sync #" + no);
}
if (no >= 0)
return;
@ -239,7 +239,7 @@ public class SequenceCheck extends SvrProcess
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
s_log.fine("#" + counter);
if (s_log.isLoggable(Level.FINE)) s_log.fine("#" + counter);
} // checkTableID

View File

@ -136,8 +136,7 @@ public class Core {
* @return initialized PaymentProcessor or null
*/
public static PaymentProcessor getPaymentProcessor(MBankAccountProcessor mbap, PaymentInterface mp) {
if (s_log.isLoggable(Level.FINE))
s_log.fine("create for " + mbap);
if (s_log.isLoggable(Level.FINE)) s_log.fine("create for " + mbap);
MPaymentProcessor mpp = new MPaymentProcessor(mbap.getCtx(), mbap.getC_PaymentProcessor_ID(), mbap.get_TrxName());
String className = mpp.getPayProcessorClass();
@ -177,8 +176,7 @@ public class Core {
*/
public static IShipmentProcessor getShipmentProcessor(MShipperFacade sf)
{
if (s_log.isLoggable(Level.FINE))
s_log.fine("create for " + sf);
if (s_log.isLoggable(Level.FINE)) s_log.fine("create for " + sf);
String className = sf.getShippingProcessorClass();
if (className == null || className.length() == 0)

View File

@ -232,7 +232,7 @@ public class DefaultModelFactory implements IModelFactory {
{
if (superClazz == PO.class)
{
s_log.fine("Use: " + className);
if (s_log.isLoggable(Level.FINE)) s_log.fine("Use: " + className);
return clazz;
}
superClazz = superClazz.getSuperclass();

View File

@ -556,7 +556,7 @@ public class Doc_Order extends Doc
if (!tax.isZeroTax())
{
BigDecimal LineNetAmtTax = tax.calculateTax(LineNetAmt, true, precision);
s_log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax);
if (s_log.isLoggable(Level.FINE)) s_log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax);
LineNetAmt = LineNetAmt.subtract(LineNetAmtTax);
BigDecimal PriceListTax = tax.calculateTax(PriceList, true, precision);
PriceList = PriceList.subtract(PriceListTax);
@ -697,7 +697,7 @@ public class Doc_Order extends Doc
if (!tax.isZeroTax())
{
BigDecimal LineNetAmtTax = tax.calculateTax(LineNetAmt, true, precision);
s_log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax);
if (s_log.isLoggable(Level.FINE)) s_log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax);
LineNetAmt = LineNetAmt.subtract(LineNetAmtTax);
BigDecimal PriceListTax = tax.calculateTax(PriceList, true, precision);
PriceList = PriceList.subtract(PriceListTax);

View File

@ -227,7 +227,7 @@ public class MAccount extends X_C_ValidCombination
s_log.log(Level.SEVERE, "Could not create new account - " + info);
return null;
}
s_log.fine("New: " + newAccount);
if (s_log.isLoggable(Level.FINE)) s_log.fine("New: " + newAccount);
return newAccount;
} // get
@ -330,7 +330,7 @@ public class MAccount extends X_C_ValidCombination
else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_UserElement2) && setValue)
vc.setUserElement2_ID(defaultValue);
}
s_log.fine("Client_ID="
if (s_log.isLoggable(Level.FINE)) s_log.fine("Client_ID="
+ vc.getAD_Client_ID() + ", Org_ID=" + vc.getAD_Org_ID()
+ " - AcctSchema_ID=" + vc.getC_AcctSchema_ID() + ", Account_ID=" + vc.getAccount_ID());
return vc;

View File

@ -60,7 +60,7 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element
if (retValue != null)
return retValue;
s_log.fine("C_AcctSchema_ID=" + as.getC_AcctSchema_ID());
if (s_log.isLoggable(Level.FINE)) s_log.fine("C_AcctSchema_ID=" + as.getC_AcctSchema_ID());
ArrayList<MAcctSchemaElement> list = new ArrayList<MAcctSchemaElement>();
final String whereClause = "C_AcctSchema_ID=? AND IsActive=?";
@ -71,7 +71,7 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element
for(MAcctSchemaElement ase : elements)
{
s_log.fine(" - " + ase);
if (s_log.isLoggable(Level.FINE)) s_log.fine(" - " + ase);
if (ase.isMandatory() && ase.getDefaultValue() == 0)
s_log.log(Level.SEVERE, "No default value for " + ase.getName());
list.add(ase);

View File

@ -6,6 +6,7 @@ import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.exceptions.FillMandatoryException;
import org.compiere.process.DocAction;
@ -35,11 +36,11 @@ import org.idempiere.fa.util.POCacheLocal;
public class MAssetAddition extends X_A_Asset_Addition
implements DocAction
{
/**
*
*/
private static final long serialVersionUID = 5977180589101094202L;
/** Static Logger */
private static CLogger s_log = CLogger.getCLogger(MAssetAddition.class);
@ -386,7 +387,7 @@ public class MAssetAddition extends X_A_Asset_Addition
}
if(CLogMgt.isLevelFine()) s_log.fine("Entering: model=" + model + ", M_MatchInv_ID=" + M_MatchInv_ID + ", newRecord=" + newRecord + ", trxName=" + trxName);
if (s_log.isLoggable(Level.FINE)) s_log.fine("Entering: model=" + model + ", M_MatchInv_ID=" + M_MatchInv_ID + ", newRecord=" + newRecord + ", trxName=" + trxName);
final String qMatchInv_select = "SELECT"
+ " C_Invoice_ID"
@ -435,7 +436,7 @@ public class MAssetAddition extends X_A_Asset_Addition
*/
SetGetUtil.updateColumns(model, null, query, trxName);
if(CLogMgt.isLevelFine()) s_log.fine("Leaving: RETURN TRUE");
s_log.fine("Leaving: RETURN TRUE");
return true;
}

View File

@ -15,6 +15,7 @@ package org.compiere.model;
import java.sql.ResultSet;
import java.util.Properties;
import java.util.logging.Level;
import org.compiere.model.MRefList;
import org.compiere.model.PO;
@ -103,7 +104,7 @@ public class MAssetChange extends X_A_Asset_Change
}
public static MAssetChange create(Properties ctx, String changeType, PO[] pos, boolean save, String trxName) {
s_log.fine("Entering: changeType=" + changeType);
if (s_log.isLoggable(Level.FINE)) s_log.fine("Entering: changeType=" + changeType);
if (pos == null || pos.length == 0) {
s_log.fine("Entering/Leaving: POs is empty");
return null;
@ -117,7 +118,7 @@ public class MAssetChange extends X_A_Asset_Change
change.saveEx();
}
//
s_log.fine("Leaving: change=" + change);
if (s_log.isLoggable(Level.FINE)) s_log.fine("Leaving: change=" + change);
return change;
}

View File

@ -21,6 +21,7 @@ import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
@ -74,7 +75,7 @@ public class MAttribute extends X_M_Attribute
MAttribute[] retValue = new MAttribute[list.size ()];
list.toArray (retValue);
s_log.fine("AD_Client_ID=" + AD_Client_ID + " - #" + list.size());
if (s_log.isLoggable(Level.FINE)) s_log.fine("AD_Client_ID=" + AD_Client_ID + " - #" + list.size());
return retValue;
} // getOfClient

View File

@ -61,11 +61,11 @@ public class MAttributeSetInstance extends X_M_AttributeSetInstance
// Load Instance if not 0
if (M_AttributeSetInstance_ID != 0)
{
s_log.fine("From M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID);
if (s_log.isLoggable(Level.FINE)) s_log.fine("From M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID);
return new MAttributeSetInstance (ctx, M_AttributeSetInstance_ID, null);
}
// Get new from Product
s_log.fine("From M_Product_ID=" + M_Product_ID);
if (s_log.isLoggable(Level.FINE)) s_log.fine("From M_Product_ID=" + M_Product_ID);
if (M_Product_ID == 0)
return null;
String sql = "SELECT M_AttributeSet_ID, M_AttributeSetInstance_ID "

View File

@ -122,7 +122,7 @@ public class MBankAccountProcessor extends X_C_BankAccount_Processor {
s_log.warning("find - not found - AD_Client_ID=" + AD_Client_ID
+ ", C_Currency_ID=" + C_Currency_ID + ", Amt=" + Amt);
else
s_log.fine("find - #" + list.size() + " - AD_Client_ID=" + AD_Client_ID
if (s_log.isLoggable(Level.FINE)) s_log.fine("find - #" + list.size() + " - AD_Client_ID=" + AD_Client_ID
+ ", C_Currency_ID=" + C_Currency_ID + ", Amt=" + Amt);
MBankAccountProcessor[] retValue = new MBankAccountProcessor[list.size()];
list.toArray(retValue);

View File

@ -19,6 +19,7 @@ package org.compiere.model;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;
import java.util.logging.Level;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
@ -62,10 +63,10 @@ public class MContactInterest extends X_R_ContactInterest
{
retValue = new MContactInterest (ctx, R_InterestArea_ID, AD_User_ID,
isActive, trxName);
s_log.fine("NOT found - " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine("NOT found - " + retValue);
}
else
s_log.fine("Found - " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine("Found - " + retValue);
return retValue;
} // get

View File

@ -6,8 +6,8 @@ package org.compiere.model;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Timestamp;
import java.util.logging.Level;
import org.compiere.util.CLogMgt;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.idempiere.exceptions.NoCurrencyConversionException;
@ -97,7 +97,7 @@ public final class MConversionRateUtil
if (AmtName != null)
model.set_AttrValue(AmtName, amt);
// Return amt
if (CLogMgt.isLevelFine()) s_log.fine("amt=" + sourceAmt + " * " + rate + "=" + amt + ", scale=" + stdPrecision);
if (s_log.isLoggable(Level.FINE)) s_log.fine("amt=" + sourceAmt + " * " + rate + "=" + amt + ", scale=" + stdPrecision);
return amt;
} // convert
}

View File

@ -296,7 +296,7 @@ public class MCost extends X_M_Cost
throw new IllegalArgumentException("Unknown Costing Method = " + costingMethod);
if (retValue != null && retValue.signum() > 0)
{
s_log.fine(product.getName() + ", CostingMethod=" + costingMethod + " - " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", CostingMethod=" + costingMethod + " - " + retValue);
return retValue;
}
@ -306,7 +306,7 @@ public class MCost extends X_M_Cost
retValue = getPOPrice(product, C_OrderLine_ID, as.getC_Currency_ID());
if (retValue != null && retValue.signum() > 0)
{
s_log.fine(product.getName() + ", PO - " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", PO - " + retValue);
return retValue;
}
}
@ -318,7 +318,7 @@ public class MCost extends X_M_Cost
MCost cost = get(product, M_ASI_ID, as, Org_ID, ce.getM_CostElement_ID(), product.get_TrxName());
if (cost != null && cost.getCurrentCostPrice().signum() > 0)
{
s_log.fine(product.getName() + ", Standard - " + cost);
if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", Standard - " + cost);
return cost.getCurrentCostPrice();
}
}
@ -334,7 +334,7 @@ public class MCost extends X_M_Cost
retValue = getLastPOPrice(product, M_ASI_ID, 0, as.getC_Currency_ID());
if (retValue != null && retValue.signum() > 0)
{
s_log.fine(product.getName() + ", LastPO = " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", LastPO = " + retValue);
return retValue;
}
}
@ -346,7 +346,7 @@ public class MCost extends X_M_Cost
retValue = getLastInvoicePrice(product, M_ASI_ID, 0, as.getC_Currency_ID());
if (retValue != null && retValue.signum() != 0)
{
s_log.fine(product.getName() + ", LastInv = " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", LastInv = " + retValue);
return retValue;
}
}
@ -362,7 +362,7 @@ public class MCost extends X_M_Cost
retValue = getLastInvoicePrice(product, M_ASI_ID, 0, as.getC_Currency_ID());
if (retValue != null && retValue.signum() > 0)
{
s_log.fine(product.getName() + ", LastInv = " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", LastInv = " + retValue);
return retValue;
}
}
@ -374,7 +374,7 @@ public class MCost extends X_M_Cost
retValue = getLastPOPrice(product, M_ASI_ID, 0, as.getC_Currency_ID());
if (retValue != null && retValue.signum() > 0)
{
s_log.fine(product.getName() + ", LastPO = " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", LastPO = " + retValue);
return retValue;
}
}
@ -402,7 +402,7 @@ public class MCost extends X_M_Cost
if (price != null && price.signum() != 0)
{
retValue = price;
s_log.fine(product.getName() + ", Product_PO = " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + ", Product_PO = " + retValue);
return retValue;
}
}
@ -415,7 +415,7 @@ public class MCost extends X_M_Cost
retValue = price;
}
s_log.fine(product.getName() + " = " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine(product.getName() + " = " + retValue);
return retValue;
} // getSeedCosts

View File

@ -184,7 +184,7 @@ public class MCostQueue extends X_M_CostQueue
queue.setCurrentQty(newQty);
if (queue.save())
{
s_log.fine("Qty=" + remainingQty
if (s_log.isLoggable(Level.FINE)) s_log.fine("Qty=" + remainingQty
+ "(!), ASI=" + queue.getM_AttributeSetInstance_ID()
+ " - " + oldQty + " -> " + newQty);
return queue.getCurrentCostPrice();
@ -204,7 +204,7 @@ public class MCostQueue extends X_M_CostQueue
queue.setCurrentQty(newQty);
if (queue.save())
{
s_log.fine("Qty=" + reduction
if (s_log.isLoggable(Level.FINE)) s_log.fine("Qty=" + reduction
+ ", ASI=" + queue.getM_AttributeSetInstance_ID()
+ " - " + oldQty + " -> " + newQty);
remainingQty = remainingQty.subtract(reduction);
@ -219,7 +219,7 @@ public class MCostQueue extends X_M_CostQueue
}
} // for queue
s_log.fine("RemainingQty=" + remainingQty);
if (s_log.isLoggable(Level.FINE)) s_log.fine("RemainingQty=" + remainingQty);
return null;
} // adjustQty
@ -275,7 +275,7 @@ public class MCostQueue extends X_M_CostQueue
lastPrice = queue.getCurrentCostPrice();
BigDecimal costBatch = lastPrice.multiply(reduction);
cost = cost.add(costBatch);
s_log.fine("ASI=" + queue.getM_AttributeSetInstance_ID()
if (s_log.isLoggable(Level.FINE)) s_log.fine("ASI=" + queue.getM_AttributeSetInstance_ID()
+ " - Cost=" + lastPrice + " * Qty=" + reduction + " = " + costBatch);
remainingQty = remainingQty.subtract(reduction);
// Done

View File

@ -142,7 +142,7 @@ public final class MCountry extends X_C_Country
}
if (s_default == null)
s_default = usa;
s_log.fine("#" + s_countries.size()
if (s_log.isLoggable(Level.FINE)) s_log.fine("#" + s_countries.size()
+ " - Default=" + s_default);
} // loadAllCountries

View File

@ -3,6 +3,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.ResultSet;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.compiere.model.Query;
@ -372,7 +373,7 @@ public class MDepreciation extends X_A_Depreciation
amt_sl = amt_r.divide(new BigDecimal(A_RemainingLife_Year), getPrecision(), RoundingMode.HALF_UP);
// logging
if (CLogMgt.isLevelFinest()) {
s_log.fine("amt_r=" + amt_r + ", amt_ad1=amt_r*coef_ad1=" + amt_ad1 + ", amt_sl=amt_r/A_RemainingLife_Year=" + amt_sl + ", A_Current_Year=" + A_Current_Year + ", A_RemainingLife_Year=" + A_RemainingLife_Year);
if (s_log.isLoggable(Level.FINE)) s_log.fine("amt_r=" + amt_r + ", amt_ad1=amt_r*coef_ad1=" + amt_ad1 + ", amt_sl=amt_r/A_RemainingLife_Year=" + amt_sl + ", A_Current_Year=" + A_Current_Year + ", A_RemainingLife_Year=" + A_RemainingLife_Year);
}
/** If the first year or if the value depreciation value depreciation degressive more linear ... */
@ -382,7 +383,7 @@ public class MDepreciation extends X_A_Depreciation
else {
amtPerYear = amt_sl;
is_SL = true;
s_log.fine("*** PASS IT ON linear amt_sl= " + amt_sl + " ***");
if (s_log.isLoggable(Level.FINE)) s_log.fine("*** PASS IT ON linear amt_sl= " + amt_sl + " ***");
}
}
else {
@ -391,9 +392,9 @@ public class MDepreciation extends X_A_Depreciation
}
amt_r = amt_r.subtract(amtPerYear);
if (CLogMgt.isLevelFinest()) s_log.fine("year=" + curr_year + ", amtPerYear=" + amtPerYear + ", amt_r=" + amt_r); //logging
if (s_log.isLoggable(Level.FINE)) s_log.fine("year=" + curr_year + ", amtPerYear=" + amtPerYear + ", amt_r=" + amt_r); //logging
}
if (CLogMgt.isLevelFinest()) s_log.fine("amt_r=" + amt_r + ", amtPerYear=" + amtPerYear); //logging
if (s_log.isLoggable(Level.FINE)) s_log.fine("amt_r=" + amt_r + ", amtPerYear=" + amtPerYear); //logging
/** Damping value for the current month */
BigDecimal assetExp = getPeriodExp(A_Current_Period, amtPerYear);

View File

@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import org.compiere.model.MDocType;
import org.compiere.model.MPeriod;
@ -94,7 +95,7 @@ public class MDepreciationExp extends X_A_Depreciation_Exp
//
depexp.updateFrom(assetwk);
//
s_log.fine("depexp=" + depexp);
if (s_log.isLoggable(Level.FINE)) s_log.fine("depexp=" + depexp);
return depexp;
}

View File

@ -75,7 +75,7 @@ public class MFactAcct extends X_Fact_Acct
{
final String sql = "DELETE Fact_Acct WHERE AD_Table_ID=? AND Record_ID=?";
int no = DB.executeUpdateEx(sql, new Object[]{AD_Table_ID, Record_ID}, trxName);
s_log.fine("delete - AD_Table_ID=" + AD_Table_ID + ", Record_ID=" + Record_ID + " - #" + no);
if (s_log.isLoggable(Level.FINE)) s_log.fine("delete - AD_Table_ID=" + AD_Table_ID + ", Record_ID=" + Record_ID + " - #" + no);
return no;
}

View File

@ -21,6 +21,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.exceptions.DBException;
import org.compiere.util.CLogger;
@ -80,7 +81,7 @@ public class MInvoiceTax extends X_C_InvoiceTax
{
retValue.set_TrxName(trxName);
retValue.setPrecision(precision);
s_log.fine("(old=" + oldTax + ") " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine("(old=" + oldTax + ") " + retValue);
return retValue;
}
// If the old tax was required and there is no MInvoiceTax for that
@ -98,7 +99,7 @@ public class MInvoiceTax extends X_C_InvoiceTax
retValue.setC_Tax_ID(line.getC_Tax_ID());
retValue.setPrecision(precision);
retValue.setIsTaxIncluded(line.isTaxIncluded());
s_log.fine("(new) " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine("(new) " + retValue);
return retValue;
} // get

View File

@ -19,6 +19,7 @@ package org.compiere.model;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.logging.Level;
import org.compiere.util.CCache;
import org.compiere.util.CLogger;
@ -115,7 +116,7 @@ public class MLookupCache
lookupTarget.put(cacheKey, cacheData);
}
s_log.fine("#" + lookupTarget.size());
if (s_log.isLoggable(Level.FINE)) s_log.fine("#" + lookupTarget.size());
return true;
} // loadFromCache
@ -141,7 +142,7 @@ public class MLookupCache
for (int i = 0; i < toDelete.size(); i++)
s_loadedLookups.remove(toDelete.get(i));
int endNo = s_loadedLookups.size();
s_log.fine("WindowNo=" + WindowNo
if (s_log.isLoggable(Level.FINE)) s_log.fine("WindowNo=" + WindowNo
+ " - " + startNo + " -> " + endNo);
} // cacheReset

View File

@ -217,8 +217,7 @@ public class MLookupFactory
return null;
}
info.Query = newSQL;
if (s_log.isLoggable(Level.FINE))
s_log.fine("getLookupInfo, newSQL ="+newSQL); //jz
if (s_log.isLoggable(Level.FINE)) s_log.fine("getLookupInfo, newSQL ="+newSQL); //jz
}
// Direct Query - NO Validation/Security
@ -231,8 +230,7 @@ public class MLookupFactory
return null;
}
info.QueryDirect = newSQL;
if (s_log.isLoggable(Level.FINE))
s_log.fine("getLookupInfo, newSQL ="+newSQL); //jz
if (s_log.isLoggable(Level.FINE)) s_log.fine("getLookupInfo, newSQL ="+newSQL); //jz
}
// Validation
@ -760,8 +758,7 @@ public class MLookupFactory
realSQL.append(" ORDER BY 3");
MQuery zoomQuery = null; // corrected in VLookup
if (s_log.isLoggable(Level.FINE))
s_log.fine("ColumnName=" + ColumnName + " - " + realSQL);
if (s_log.isLoggable(Level.FINE)) s_log.fine("ColumnName=" + ColumnName + " - " + realSQL);
StringBuilder msginf = new StringBuilder().append(TableName).append(".").append(KeyColumn);
MLookupInfo lInfo = new MLookupInfo(realSQL.toString(), TableName,
msginf.toString(), ZoomWindow, ZoomWindowPO, zoomQuery);

View File

@ -108,7 +108,7 @@ public class MOrderLine extends X_C_OrderLine
if (retValue == null)
s_log.fine("-");
else
s_log.fine(retValue.toString());
if (s_log.isLoggable(Level.FINE)) s_log.fine(retValue.toString());
return retValue;
} // getNotReserved

View File

@ -101,7 +101,7 @@ public class MOrderTax extends X_C_OrderTax
{
retValue.setPrecision(precision);
retValue.set_TrxName(trxName);
s_log.fine("(old=" + oldTax + ") " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine("(old=" + oldTax + ") " + retValue);
return retValue;
}
// If the old tax was required and there is no MOrderTax for that
@ -119,7 +119,7 @@ public class MOrderTax extends X_C_OrderTax
retValue.setC_Tax_ID(line.getC_Tax_ID());
retValue.setPrecision(precision);
retValue.setIsTaxIncluded(line.isTaxIncluded());
s_log.fine("(new) " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine("(new) " + retValue);
return retValue;
} // get

View File

@ -202,7 +202,7 @@ public final class MPaySelectionCheck extends X_C_PaySelectionCheck
static public MPaySelectionCheck[] get (int C_PaySelection_ID,
String PaymentRule, int startDocumentNo, String trxName)
{
s_log.fine("C_PaySelection_ID=" + C_PaySelection_ID
if (s_log.isLoggable(Level.FINE)) s_log.fine("C_PaySelection_ID=" + C_PaySelection_ID
+ ", PaymentRule=" + PaymentRule + ", startDocumentNo=" + startDocumentNo);
ArrayList<MPaySelectionCheck> list = new ArrayList<MPaySelectionCheck>();
@ -300,11 +300,11 @@ public final class MPaySelectionCheck extends X_C_PaySelectionCheck
}
// Link to Invoice
MPaySelectionLine[] psls = check.getPaySelectionLines(false);
s_log.fine("confirmPrint - " + check + " (#SelectionLines=" + psls.length + ")");
if (s_log.isLoggable(Level.FINE)) s_log.fine("confirmPrint - " + check + " (#SelectionLines=" + psls.length + ")");
if (check.getQty() == 1 && psls != null && psls.length == 1)
{
MPaySelectionLine psl = psls[0];
s_log.fine("Map to Invoice " + psl);
if (s_log.isLoggable(Level.FINE)) s_log.fine("Map to Invoice " + psl);
//
payment.setC_Invoice_ID (psl.getC_Invoice_ID());
payment.setDiscountAmt (psl.getDiscountAmt());
@ -352,7 +352,7 @@ public final class MPaySelectionCheck extends X_C_PaySelectionCheck
s_log.log(Level.SEVERE, "Check not saved: " + check);
} // all checks
s_log.fine("Last Document No = " + lastDocumentNo);
if (s_log.isLoggable(Level.FINE)) s_log.fine("Last Document No = " + lastDocumentNo);
return lastDocumentNo;
} // confirmPrint

View File

@ -18,6 +18,7 @@ package org.compiere.model;
import java.util.Calendar;
import java.util.StringTokenizer;
import java.util.logging.Level;
import org.compiere.util.CLogger;
@ -185,7 +186,7 @@ public class MPaymentValidate
if (sum % 10 == 0)
return "";
s_log.fine("validateCreditCardNumber - " + creditCardNumber + " -> "
if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardNumber - " + creditCardNumber + " -> "
+ ccNumber + ", Luhn=" + sum);
return "CreditCardNumberError";
} // validateCreditCardNumber
@ -263,7 +264,7 @@ public class MPaymentValidate
}
if (!ccLengthOK)
{
s_log.fine("validateCreditCardNumber Length="
if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardNumber Length="
+ ccLength + " <> " + ccLengthList);
return "CreditCardNumberError";
}
@ -279,7 +280,7 @@ public class MPaymentValidate
ccIdentified = true;
}
if (!ccIdentified)
s_log.fine("validateCreditCardNumber Type="
if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardNumber Type="
+ creditCardType + " <> " + ccStartList);
//
@ -311,9 +312,9 @@ public class MPaymentValidate
}
catch (NumberFormatException ex)
{
s_log.fine("validateCreditCardVV - " + ex);
if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV - " + ex);
}
s_log.fine("validateCreditCardVV - length=" + length);
if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV - length=" + length);
return "CreditCardVVError";
} // validateCreditCardVV
@ -344,10 +345,10 @@ public class MPaymentValidate
}
catch (NumberFormatException ex)
{
s_log.fine("validateCreditCardVV - " + ex);
if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV - " + ex);
}
}
s_log.fine("validateCreditCardVV(4) CC=" + creditCardType + ", length=" + length);
if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV(4) CC=" + creditCardType + ", length=" + length);
return "CreditCardVVError";
}
// Visa & MasterCard - 3 digits
@ -363,10 +364,10 @@ public class MPaymentValidate
}
catch (NumberFormatException ex)
{
s_log.fine("validateCreditCardVV - " + ex);
if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV - " + ex);
}
}
s_log.fine("validateCreditCardVV(3) CC=" + creditCardType + ", length=" + length);
if (s_log.isLoggable(Level.FINE)) s_log.fine("validateCreditCardVV(3) CC=" + creditCardType + ", length=" + length);
return "CreditCardVVError";
}

View File

@ -101,7 +101,7 @@ public class MProductCategory extends X_M_Product_Category
// TODO: LRU logic
s_products.put(product, category);
//
s_log.fine("M_Product_ID=" + M_Product_ID + "(" + category
if (s_log.isLoggable(Level.FINE)) s_log.fine("M_Product_ID=" + M_Product_ID + "(" + category
+ ") in M_Product_Category_ID=" + M_Product_Category_ID
+ " - " + (category.intValue() == M_Product_Category_ID));
return category.intValue() == M_Product_Category_ID;

View File

@ -139,7 +139,7 @@ public class MQuery implements Serializable
String Name = rs.getString(10);
boolean isRange = "Y".equals(rs.getString(11));
//
s_log.fine(ParameterName + " S=" + P_String + "-" + P_String_To
if (s_log.isLoggable(Level.FINE)) s_log.fine(ParameterName + " S=" + P_String + "-" + P_String_To
+ ", N=" + P_Number + "-" + P_Number_To + ", D=" + P_Date + "-" + P_Date_To
+ "; Name=" + Name + ", Info=" + Info + "-" + Info_To + ", Range=" + isRange);
//

View File

@ -96,7 +96,7 @@ public class MRMATax extends X_M_RMATax
{
retValue.setPrecision(precision);
retValue.set_TrxName(trxName);
s_log.fine("(old=" + oldTax + ") " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine("(old=" + oldTax + ") " + retValue);
return retValue;
}
// If the old tax was required and there is no MOrderTax for that
@ -114,7 +114,7 @@ public class MRMATax extends X_M_RMATax
retValue.setC_Tax_ID(line.getC_Tax_ID());
retValue.setPrecision(precision);
retValue.setIsTaxIncluded(line.getParent().isTaxIncluded());
s_log.fine("(new) " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine("(new) " + retValue);
return retValue;
}

View File

@ -81,7 +81,7 @@ public final class MRegion extends X_C_Region
rs = null;
stmt = null;
}
s_log.fine(s_regions.size() + " - default=" + s_default);
if (s_log.isLoggable(Level.FINE)) s_log.fine(s_regions.size() + " - default=" + s_default);
} // loadAllRegions
/**

View File

@ -449,7 +449,7 @@ public class MSequence extends X_AD_Sequence
// + " - Type=" + pstmt.getResultSetType() + " - Concur=" + pstmt.getResultSetConcurrency());
if (rs.next())
{
s_log.fine("AD_Sequence_ID="+AD_Sequence_ID);
if (s_log.isLoggable(Level.FINE)) s_log.fine("AD_Sequence_ID="+AD_Sequence_ID);
PreparedStatement updateSQL = null;
try
@ -656,7 +656,7 @@ public class MSequence extends X_AD_Sequence
while (rs.next())
{
String tableName = rs.getString(1);
s_log.fine("Add: " + tableName);
if (s_log.isLoggable(Level.FINE)) s_log.fine("Add: " + tableName);
MSequence seq = new MSequence (ctx, AD_Client_ID, tableName, trxName);
if (seq.save())
counter++;

View File

@ -67,10 +67,10 @@ public class MStorageOnHand extends X_M_StorageOnHand
.first();
if (retValue == null)
s_log.fine("Not Found - M_Locator_ID=" + M_Locator_ID
if (s_log.isLoggable(Level.FINE)) s_log.fine("Not Found - M_Locator_ID=" + M_Locator_ID
+ ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID);
else
s_log.fine("M_Locator_ID=" + M_Locator_ID
if (s_log.isLoggable(Level.FINE)) s_log.fine("M_Locator_ID=" + M_Locator_ID
+ ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID);
return retValue;
} // get
@ -339,7 +339,7 @@ public class MStorageOnHand extends X_M_StorageOnHand
//
retValue = new MStorageOnHand (locator, M_Product_ID, M_AttributeSetInstance_ID);
retValue.saveEx(trxName);
s_log.fine("New " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine("New " + retValue);
return retValue;
} // getCreate
@ -380,7 +380,7 @@ public class MStorageOnHand extends X_M_StorageOnHand
storage.setQtyOnHand (storage.getQtyOnHand().add (diffQtyOnHand));
if (s_log.isLoggable(Level.FINE)) {
StringBuilder diffText = new StringBuilder("(OnHand=").append(diffQtyOnHand).append(") -> ").append(storage.toString());
s_log.fine(diffText.toString());
if (s_log.isLoggable(Level.FINE)) s_log.fine(diffText.toString());
}
return storage.save (trxName);
} // add

View File

@ -75,10 +75,10 @@ public class MStorageReservation extends X_M_StorageReservation {
rs = null; pstmt = null;
}
if (retValue == null)
s_log.fine("Not Found - M_Warehouse_ID=" + M_Warehouse_ID
if (s_log.isLoggable(Level.FINE)) s_log.fine("Not Found - M_Warehouse_ID=" + M_Warehouse_ID
+ ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID + ", IsSOTrx=" + isSOTrx);
else
s_log.fine("M_Warehouse_ID=" + M_Warehouse_ID
if (s_log.isLoggable(Level.FINE)) s_log.fine("M_Warehouse_ID=" + M_Warehouse_ID
+ ", M_Product_ID=" + M_Product_ID + ", M_AttributeSetInstance_ID=" + M_AttributeSetInstance_ID + ", IsSOTrx=" + isSOTrx);
return retValue;
} // get
@ -257,7 +257,7 @@ public class MStorageReservation extends X_M_StorageReservation {
storage.setQty (storage.getQty().add(diffQty));
if (s_log.isLoggable(Level.FINE)) {
StringBuilder diffText = new StringBuilder("(Qty=").append(diffQty).append(") -> ").append(storage.toString());
s_log.fine(diffText.toString());
if (s_log.isLoggable(Level.FINE)) s_log.fine(diffText.toString());
}
return storage.save (trxName);
} // add
@ -289,7 +289,7 @@ public class MStorageReservation extends X_M_StorageReservation {
//
retValue = new MStorageReservation (warehouse, M_Product_ID, M_AttributeSetInstance_ID, isSOTrx);
retValue.saveEx(trxName);
s_log.fine("New " + retValue);
if (s_log.isLoggable(Level.FINE)) s_log.fine("New " + retValue);
return retValue;
} // getCreate

View File

@ -533,7 +533,7 @@ public class MUOMConversion extends X_C_UOM_Conversion
if (qtyPrice == null || qtyPrice.compareTo(Env.ZERO)==0
|| C_UOM_To_ID == 0|| M_Product_ID == 0)
{
s_log.fine("No Conversion - QtyPrice=" + qtyPrice);
if (s_log.isLoggable(Level.FINE)) s_log.fine("No Conversion - QtyPrice=" + qtyPrice);
return qtyPrice;
}
@ -547,7 +547,7 @@ public class MUOMConversion extends X_C_UOM_Conversion
return uom.round(retValue.multiply(qtyPrice), true);
return retValue.multiply(qtyPrice);
}
s_log.fine("No Rate M_Product_ID=" + M_Product_ID);
if (s_log.isLoggable(Level.FINE)) s_log.fine("No Rate M_Product_ID=" + M_Product_ID);
return null;
} // convertProductFrom
@ -613,7 +613,7 @@ public class MUOMConversion extends X_C_UOM_Conversion
result = new MUOMConversion[list.size ()];
list.toArray (result);
s_conversionProduct.put(key, result);
s_log.fine("getProductConversions - M_Product_ID=" + M_Product_ID + " #" + result.length);
if (s_log.isLoggable(Level.FINE)) s_log.fine("getProductConversions - M_Product_ID=" + M_Product_ID + " #" + result.length);
return result;
} // getProductConversions

View File

@ -90,7 +90,7 @@ public class MWarehousePrice extends X_RV_WarehousePrice
//
String finalSQL = MRole.getDefault().addAccessSQL(sql.toString(),
"RV_WarehousePrice", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
s_log.fine("find - M_PriceList_Version_ID=" + M_PriceList_Version_ID
if (s_log.isLoggable(Level.FINE)) s_log.fine("find - M_PriceList_Version_ID=" + M_PriceList_Version_ID
+ ", M_Warehouse_ID=" + M_Warehouse_ID
+ " - " + finalSQL);
ArrayList<MWarehousePrice> list = new ArrayList<MWarehousePrice>();
@ -125,7 +125,7 @@ public class MWarehousePrice extends X_RV_WarehousePrice
pstmt = null;
}
//
s_log.fine("find - #" + list.size());
if (s_log.isLoggable(Level.FINE)) s_log.fine("find - #" + list.size());
MWarehousePrice[] retValue = new MWarehousePrice[list.size()];
list.toArray(retValue);
return retValue;

View File

@ -1238,7 +1238,7 @@ public abstract class PO
*/
public static void copyValues (PO from, PO to)
{
s_log.fine("From ID=" + from.get_ID() + " - To ID=" + to.get_ID());
if (s_log.isLoggable(Level.FINE)) s_log.fine("From ID=" + from.get_ID() + " - To ID=" + to.get_ID());
// Different Classes
if (from.getClass() != to.getClass())
{