IDEMPIERE-638 Check log level before calling logging method / .log(Level

This commit is contained in:
Richard Morales 2013-03-15 22:52:05 -05:00
parent e7f817ec2b
commit c45dfd9557
37 changed files with 102 additions and 102 deletions

View File

@ -269,7 +269,7 @@ public class FactAcctReset extends SvrProcess
sql1 += " AND TRUNC(fact.DateAcct) <= " + DB.TO_DATE(p_DateAcct_To);
sql1 += ")";
log.log(Level.FINE, sql1);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, sql1);
int reset = DB.executeUpdate(sql1, get_TrxName());
// Fact
@ -288,7 +288,7 @@ public class FactAcctReset extends SvrProcess
if (p_DateAcct_To != null)
sql2 += " AND TRUNC(Fact_Acct.DateAcct) <= " + DB.TO_DATE(p_DateAcct_To);
log.log(Level.FINE, sql2);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, sql2);
int deleted = DB.executeUpdate(sql2, get_TrxName());
//

View File

@ -553,7 +553,7 @@ public class RequestEMailProcessor extends SvrProcess
}
}
catch (IOException e) {
log.log(Level.FINE, "Error extracting attachments", e);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Error extracting attachments", e);
}
}

View File

@ -167,34 +167,34 @@ public class AddressLookup implements AddressLookupInterface {
Element firstElement = (Element) firstDataNode;
NodeList firstNameList = firstElement.getElementsByTagName("Name");
Element NameElement = (Element) firstNameList.item(0);
log.log(Level.FINE, "Name: " + NameElement.getChildNodes().item(0).getNodeValue().trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Name: " + NameElement.getChildNodes().item(0).getNodeValue().trim() + " Node: " + i);}
// Found and ADDR Node
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("ADDR")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
postcode.setAddr(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}
// Found and STREET Node
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("STREET")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
postcode.setStreet1(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}
// Found and LOCALITY Node
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("LOCALITY")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
postcode.setStreet2(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}
// Found and POSTTOWN Node
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("POSTTOWN")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
postcode.setCity(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}
@ -202,56 +202,56 @@ public class AddressLookup implements AddressLookupInterface {
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("COUNTY")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
postcode.setRegion(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}
// Found and POSTCODE Node
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("POSTCODE")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
postcode.setPostcode(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}
// Found and COUNTRY Node
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("COUNTRY")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
postcode.setCountry(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}
// Found and COUNTRYCODE Node
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("COUNTRYCODE")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
postcode.setCountryCode(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}
// Found and TRADCOUNTY Node
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("TRADCOUNTY")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
postcode.setTradCounty(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}
// Found and LONLOCOUT Node
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("LONLOCOUT")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
postcode.setLonLocation(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}
// Found and ADMINCOUNTY Node
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("ADMINCOUNTY")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
postcode.setAdminCounty(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}
// Found and ADMINCOUNTY Node
if (NameElement.getChildNodes().item(0).getNodeValue().trim().equals("RESCODE")) {
NodeList firstValueList = firstElement.getElementsByTagName("Value");
Element ValueElement = (Element) firstValueList.item(0);
log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);
if (log.isLoggable(Level.FINE)){log.log(Level.FINE, "Value: " + ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim() + " Node: " + i);}
resultCode = (int) new Integer(ValueElement.getChildNodes().item(0).getNodeValue().replaceAll("\n","").trim());
}

View File

@ -53,7 +53,7 @@ public class DefaultProcessFactory implements IProcessFactory {
}
catch (ClassNotFoundException ex)
{
log.log(Level.FINE, className, ex);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, className, ex);
}
}
if (processClass == null)

View File

@ -30,7 +30,7 @@ public class ResetLockedAccount extends SvrProcess {
else if (name.equals("AD_User_ID"))
p_AD_User_ID = element.getParameterAsInt();
else
log.log(Level.INFO, "Unknown Parameter: " + name);
if (log.isLoggable(Level.INFO))log.log(Level.INFO, "Unknown Parameter: " + name);
}
}

View File

@ -522,7 +522,7 @@ public abstract class Doc
}
catch (AverageCostingNegativeQtyException e)
{
log.log(Level.INFO, e.getLocalizedMessage(), e);
if (log.isLoggable(Level.INFO))log.log(Level.INFO, e.getLocalizedMessage(), e);
p_Status = STATUS_NotPosted;
p_Error = e.toString();
}

View File

@ -199,7 +199,7 @@ public class Doc_MatchPO extends Doc
// Nothing to post
if (difference.signum() == 0)
{
log.log(Level.FINE, "No Cost Difference for M_Product_ID=" + getM_Product_ID());
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "No Cost Difference for M_Product_ID=" + getM_Product_ID());
return facts;
}

View File

@ -2290,7 +2290,7 @@ public class GridTable extends AbstractTableModel
Object value = rowData[col];
if (value == null)
{
log.log(Level.INFO, "FK data is null - " + columnName);
if (log.isLoggable(Level.INFO))log.log(Level.INFO, "FK data is null - " + columnName);
continue;
}
if (multiRowWHERE == null)

View File

@ -124,7 +124,7 @@ public class MMediaServer extends X_CM_Media_Server
//
cmd = "list";
String[] fileNames = ftp.listNames();
log.log(Level.FINE, "Number of files in " + getFolder() + ": " + fileNames.length);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Number of files in " + getFolder() + ": " + fileNames.length);
/*
FTPFile[] files = ftp.listFiles();
@ -138,7 +138,7 @@ public class MMediaServer extends X_CM_Media_Server
for (int i = 0; i < media.length; i++)
{
if (!media[i].isSummary()) {
log.log(Level.INFO, " Deploying Media Item:" + media[i].get_ID() + media[i].getExtension());
if (log.isLoggable(Level.INFO))log.log(Level.INFO, " Deploying Media Item:" + media[i].get_ID() + media[i].getExtension());
MImage thisImage = media[i].getImage();
// Open the file and output streams

View File

@ -426,7 +426,7 @@ public class MProcess extends X_AD_Process
public void copyFrom (MProcess source)
{
log.log(Level.FINE, "Copying from:" + source + ", to: " + this);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Copying from:" + source + ", to: " + this);
setAccessLevel(source.getAccessLevel());
setAD_Form_ID(source.getAD_Form_ID());
setAD_PrintFormat_ID(source.getAD_PrintFormat_ID());

View File

@ -226,7 +226,7 @@ public class MProcessPara extends X_AD_Process_Para
public void copyFrom (MProcessPara source)
{
log.log(Level.FINE, "Copying from:" + source + ", to: " + this);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Copying from:" + source + ", to: " + this);
setAD_Element_ID(source.getAD_Element_ID());
setAD_Reference_ID(source.getAD_Reference_ID());
setAD_Reference_Value_ID(source.getAD_Reference_Value_ID());
@ -254,7 +254,7 @@ public class MProcessPara extends X_AD_Process_Para
// delete new translations and copy translations from source
String sql = "DELETE FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = ?";
int count = DB.executeUpdateEx(sql, new Object[] { getAD_Process_Para_ID() }, get_TrxName());
log.log(Level.FINE, "AD_Process_Para_Trl deleted: " + count);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "AD_Process_Para_Trl deleted: " + count);
sql = "INSERT INTO AD_Process_Para_Trl (AD_Process_Para_ID, AD_Language, " +
" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, " +
@ -263,7 +263,7 @@ public class MProcessPara extends X_AD_Process_Para
" Updated, UpdatedBy, Name, Description, Help, IsTranslated " +
" FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = ? ";
count = DB.executeUpdateEx(sql, new Object[] { getAD_Process_Para_ID(), source.getAD_Process_Para_ID() }, get_TrxName());
log.log(Level.FINE, "AD_Process_Para_Trl inserted: " + count);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "AD_Process_Para_Trl inserted: " + count);
}

View File

@ -69,14 +69,14 @@ public class MProductionLine extends X_M_ProductionLine {
public String createTransactions(Timestamp date, boolean mustBeStocked) {
// delete existing ASI records
int deleted = deleteMA();
log.log(Level.FINE, "Deleted " + deleted + " attribute records ");
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Deleted " + deleted + " attribute records ");
MProduct prod = new MProduct(getCtx(), getM_Product_ID(), get_TrxName());
log.log(Level.FINE,"Loaded Product " + prod.toString());
if (log.isLoggable(Level.FINE))log.log(Level.FINE,"Loaded Product " + prod.toString());
if ( prod.getProductType().compareTo(MProduct.PRODUCTTYPE_Item ) != 0 ) {
// no need to do any movements
log.log(Level.FINE, "Production Line " + getLine() + " does not require stock movement");
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Production Line " + getLine() + " does not require stock movement");
return "";
}
StringBuilder errorString = new StringBuilder();
@ -86,7 +86,7 @@ public class MProductionLine extends X_M_ProductionLine {
if ( asiString == null )
asiString = "";
log.log(Level.FINEST, "asi Description is: " + asiString);
if (log.isLoggable(Level.FINEST)) log.log(Level.FINEST, "asi Description is: " + asiString);
// create transactions for finished goods
if ( getMovementQty().compareTo(Env.ZERO) > 0 ) {
MProductionLineMA lineMA = new MProductionLineMA( this,
@ -111,7 +111,7 @@ public class MProductionLine extends X_M_ProductionLine {
log.log(Level.SEVERE, "Could not update storage for " + toString());
errorString.append("Could not save transaction for " + toString() + "\n");
}
log.log(Level.FINE, "Created finished goods line " + getLine());
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Created finished goods line " + getLine());
return errorString.toString();
}
@ -129,7 +129,7 @@ public class MProductionLine extends X_M_ProductionLine {
BigDecimal lineQty = storages[sl].getQtyOnHand();
log.log(Level.FINE, "QtyAvailable " + lineQty );
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "QtyAvailable " + lineQty );
if (lineQty.signum() > 0)
{
if (lineQty.compareTo(qtyToMove ) > 0)
@ -141,7 +141,7 @@ public class MProductionLine extends X_M_ProductionLine {
if (slASIString == null)
slASIString = "";
log.log(Level.FINEST,"slASI-Description =" + slASIString);
if (log.isLoggable(Level.FINEST))log.log(Level.FINEST,"slASI-Description =" + slASIString);
if ( slASIString.compareTo(asiString) == 0
|| asi.getM_AttributeSet_ID() == 0 )
@ -153,9 +153,9 @@ public class MProductionLine extends X_M_ProductionLine {
if ( !lineMA.save(get_TrxName()) ) {
log.log(Level.SEVERE, "Could not save MA for " + toString());
errorString.append("Could not save MA for " + toString() + "\n" );
} else {
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Saved MA for " + toString());
}
else
log.log(Level.FINE, "Saved MA for " + toString());
matTrx = new MTransaction (getCtx(), getAD_Org_ID(),
"P-",
getM_Locator_ID(), getM_Product_ID(), asi.get_ID(),
@ -164,16 +164,16 @@ public class MProductionLine extends X_M_ProductionLine {
if ( !matTrx.save(get_TrxName()) ) {
log.log(Level.SEVERE, "Could not save transaction for " + toString());
errorString.append("Could not save transaction for " + toString() + "\n");
} else {
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Saved transaction for " + toString());
}
else
log.log(Level.FINE, "Saved transaction for " + toString());
storages[sl].changeQtyOnHand(lineQty, false);
if ( !storages[sl].save(get_TrxName()) ) {
log.log(Level.SEVERE, "Could not update storage for " + toString());
errorString.append("Could not update storage for " + toString() + "\n");
}
qtyToMove = qtyToMove.subtract(lineQty);
log.log(Level.FINE, getLine() + " Qty moved = " + lineQty + ", Remaining = " + qtyToMove );
if (log.isLoggable(Level.FINE))log.log(Level.FINE, getLine() + " Qty moved = " + lineQty + ", Remaining = " + qtyToMove );
}
}
@ -210,7 +210,7 @@ public class MProductionLine extends X_M_ProductionLine {
if (slASIString == null)
slASIString = "";
log.log(Level.FINEST,"slASI-Description =" + slASIString);
if (log.isLoggable(Level.FINEST))log.log(Level.FINEST,"slASI-Description =" + slASIString);
if ( slASIString.compareTo(asiString) == 0
|| asi.getM_AttributeSet_ID() == 0 )
@ -226,9 +226,9 @@ public class MProductionLine extends X_M_ProductionLine {
if ( !lineMA.save(get_TrxName()) ) {
log.log(Level.SEVERE, "Could not save MA for " + toString());
errorString.append("Could not save MA for " + toString() + "\n" );
} else {
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Saved MA for " + toString());
}
else
log.log(Level.FINE, "Saved MA for " + toString());
matTrx = new MTransaction (getCtx(), getAD_Org_ID(),
"P-",
getM_Locator_ID(), getM_Product_ID(), asi.get_ID(),
@ -237,16 +237,16 @@ public class MProductionLine extends X_M_ProductionLine {
if ( !matTrx.save(get_TrxName()) ) {
log.log(Level.SEVERE, "Could not save transaction for " + toString());
errorString.append("Could not save transaction for " + toString() + "\n");
} else {
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Saved transaction for " + toString());
}
else
log.log(Level.FINE, "Saved transaction for " + toString());
storage.changeQtyOnHand(lineQty, false);
if ( !storage.save(get_TrxName()) ) {
log.log(Level.SEVERE, "Could not update storage for " + toString());
errorString.append("Could not update storage for " + toString() + "\n");
}
qtyToMove = qtyToMove.subtract(lineQty);
log.log(Level.FINE, getLine() + " Qty moved = " + lineQty + ", Remaining = " + qtyToMove );
if (log.isLoggable(Level.FINE))log.log(Level.FINE, getLine() + " Qty moved = " + lineQty + ", Remaining = " + qtyToMove );
}
}

View File

@ -71,7 +71,7 @@ public class MReportCube extends X_PA_ReportCube {
start = System.currentTimeMillis();
KeyNamePair[] changedPeriods = DB.getKeyNamePairs(sql, false, getPA_ReportCube_ID());
elapsed = (System.currentTimeMillis() - start)/1000;
log.log(Level.FINE, "Selecting changed periods took:" + elapsed + "s");
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Selecting changed periods took:" + elapsed + "s");
if (changedPeriods != null && changedPeriods.length > 0 )
{
@ -84,7 +84,7 @@ public class MReportCube extends X_PA_ReportCube {
periodList.delete(periodList.length() - 2, periodList.length());
periodList.append(" )");
log.log(Level.FINE, "Periods requiring update: " + periodNames.toString());
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Periods requiring update: " + periodNames.toString());
}
else
return "Nothing to update in " + getName();
@ -108,13 +108,13 @@ public class MReportCube extends X_PA_ReportCube {
{
// delete
String delSQL = "DELETE FROM Fact_Acct_Summary fas " + where;
log.log(Level.FINE, "Delete sql: " + delSQL);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Delete sql: " + delSQL);
start = System.currentTimeMillis();
int deleted = DB.executeUpdateEx(delSQL, get_TrxName());
elapsed = (System.currentTimeMillis() - start)/1000;
result += "Deleted " + deleted + " in " + elapsed + " s;";
log.log(Level.FINE, result);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, result);
// insert
StringBuilder insert = new StringBuilder("INSERT " +
@ -189,7 +189,7 @@ public class MReportCube extends X_PA_ReportCube {
String sql = insert.append(select.toString()).append(from).append(groups.toString()).toString();
log.log(Level.FINE, sql);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, sql);
Object[] params = new Object[] { getPA_ReportCube_ID(), getC_Calendar_ID() };
start = System.currentTimeMillis();
@ -197,7 +197,7 @@ public class MReportCube extends X_PA_ReportCube {
long seconds = (System.currentTimeMillis() - start)/1000;
String insertResult = "Inserted " + rows + " in " + seconds + " s.";
log.log(Level.FINE, insertResult);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, insertResult);
result += insertResult;
@ -206,14 +206,14 @@ public class MReportCube extends X_PA_ReportCube {
" FROM Fact_Acct_Summary fas" +
" WHERE fas.PA_ReportCube_ID = " + getPA_ReportCube_ID();
ts = DB.getSQLValueTS(get_TrxName(), tsSQL);
log.log(Level.FINE, "Last updated: " + ts);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Last updated: " + ts);
}
catch (DBException e)
{
// failure results in null timestamp => rebuild on next run
// nothing else to do
log.log(Level.FINE, getName() + " update failed:" + e.getMessage());
if (log.isLoggable(Level.FINE))log.log(Level.FINE, getName() + " update failed:" + e.getMessage());
}
finally
{

View File

@ -1305,7 +1305,7 @@ public class MSequence extends X_AD_Sequence
System.err.println(e);
retValue = -1;
}
s_log.log(Level.INFO, "getNextID_HTTP - " + TableName + "=" + read + "(" + retValue + ")");
if (s_log.isLoggable(Level.INFO))s_log.log(Level.INFO, "getNextID_HTTP - " + TableName + "=" + read + "(" + retValue + ")");
return retValue;
}

View File

@ -1034,7 +1034,7 @@ public abstract class PO
else // if (value instanceof String)
valueString = DB.TO_STRING(value.toString());
// Save it
log.log(Level.INFO, columnName + "=" + valueString);
if (log.isLoggable(Level.INFO))log.log(Level.INFO, columnName + "=" + valueString);
m_custom.put(columnName, valueString);
return true;
} // set_CustomColumn
@ -1408,10 +1408,9 @@ public abstract class PO
}
catch (SQLException e)
{
if (p_info.isVirtualColumn(index)) // if rs constructor used
log.log(Level.FINER, "Virtual Column not loaded: " + columnName);
else
{
if (p_info.isVirtualColumn(index)) { // if rs constructor used
if (log.isLoggable(Level.FINER))log.log(Level.FINER, "Virtual Column not loaded: " + columnName);
} else {
log.log(Level.SEVERE, "(rs) - " + String.valueOf(index)
+ ": " + p_info.getTableName() + "." + p_info.getColumnName(index)
+ " (" + p_info.getColumnClass(index) + ") - " + e);
@ -1468,10 +1467,9 @@ public abstract class PO
}
catch (Exception e)
{
if (p_info.isVirtualColumn(index)) // if rs constructor used
log.log(Level.FINER, "Virtual Column not loaded: " + columnName);
else
{
if (p_info.isVirtualColumn(index)) { // if rs constructor used
if (log.isLoggable(Level.FINER))log.log(Level.FINER, "Virtual Column not loaded: " + columnName);
} else {
log.log(Level.SEVERE, "(ht) - " + String.valueOf(index)
+ ": " + p_info.getTableName() + "." + p_info.getColumnName(index)
+ " (" + p_info.getColumnClass(index) + ") - " + e);

View File

@ -80,7 +80,7 @@ public class FactReconcile extends SvrProcess
else
subselect = rule.getScript();
log.log(Level.FINE, "Rule subselect: " + subselect);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Rule subselect: " + subselect);
/* example matching rules:
@ -144,7 +144,7 @@ public class FactReconcile extends SvrProcess
pstmt.setInt(1, seq.getAD_Sequence_ID());
pstmt.setInt(2, account.get_ID());
count = pstmt.executeUpdate();
log.log(Level.FINE, "Inserted " + count + " new facts into Fact_Reconciliation");
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Inserted " + count + " new facts into Fact_Reconciliation");
// set the matchcode based on the rule found in AD_Rule
// which is a sql fragment that returns a string based on the accounting fact
@ -161,7 +161,7 @@ public class FactReconcile extends SvrProcess
pstmt.setInt(1, account.get_ID());
count = pstmt.executeUpdate();
log.log(Level.FINE, "Updated " + count + " match codes.");
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Updated " + count + " match codes.");
// remove any matchcodes that don't balance to zero
sql = "UPDATE Fact_Reconciliation " +
@ -179,7 +179,7 @@ public class FactReconcile extends SvrProcess
pstmt.setInt(2, account.get_ID());
unmatched = pstmt.executeUpdate();
log.log(Level.FINE, "Cleared match codes from " + unmatched + " unreconciled facts.");
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Cleared match codes from " + unmatched + " unreconciled facts.");
}
catch (SQLException e)

View File

@ -79,7 +79,7 @@ public class FactReconciliation extends SvrProcess
int count = pstmt.executeUpdate();
String result = Msg.getMsg(getCtx(),"@Created@") + ": " + count + ", ";
log.log(Level.FINE, result);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, result);
sql = "DELETE FROM T_Reconciliation t " +
"WHERE (SELECT SUM(f.amtacctdr-f.amtacctcr) FROM T_Reconciliation r " +
@ -93,7 +93,7 @@ public class FactReconciliation extends SvrProcess
count = pstmt.executeUpdate();
result = Msg.getMsg(getCtx(), "@Deleted@") + ": " + count;
log.log(Level.FINE, result);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, result);
}

View File

@ -276,7 +276,7 @@ public class FinReport extends SvrProcess
{
MReportCube cube = new MReportCube(getCtx(), p_PA_ReportCube_ID, get_TrxName());
String result = cube.update(false, false);
log.log(Level.FINE, result);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, result);
}
// ** Create Temporary and empty Report Lines from PA_ReportLine
// - AD_PInstance_ID, PA_ReportLine_ID, 0, 0

View File

@ -230,7 +230,7 @@ public class CLogMgt
Logger rootLogger = getRootLogger();
rootLogger.addHandler(handler);
//
log.log(Level.CONFIG, "Handler=" + handler);
if (log.isLoggable(Level.CONFIG))log.log(Level.CONFIG, "Handler=" + handler);
} // addHandler
@ -246,7 +246,7 @@ public class CLogMgt
{
handlers[i].setFormatter(formatter);
}
log.log(Level.CONFIG, "Formatter=" + formatter);
if (log.isLoggable(Level.CONFIG))log.log(Level.CONFIG, "Formatter=" + formatter);
} // setFormatter
/**
@ -261,7 +261,7 @@ public class CLogMgt
{
handlers[i].setFilter(filter);
}
log.log(Level.CONFIG, "Filter=" + filter);
if (log.isLoggable(Level.CONFIG))log.log(Level.CONFIG, "Filter=" + filter);
} // setFilter
/**
@ -362,7 +362,7 @@ public class CLogMgt
return;
}
}
log.log(Level.CONFIG, "Ignored: " + levelString);
if (log.isLoggable(Level.CONFIG))log.log(Level.CONFIG, "Ignored: " + levelString);
}
/**
@ -793,8 +793,10 @@ public class CLogMgt
{
log1.log(Level.SEVERE, "error message", e);
}
log1.log(Level.INFO, "info message 1", "1Param");
log1.log(Level.INFO, "info message n", new Object[]{"1Param","2Param"});
if (log1.isLoggable(Level.INFO)){
log1.log(Level.INFO, "info message 1", "1Param");
log1.log(Level.INFO, "info message n", new Object[]{"1Param","2Param"});
}
} // testLog
/**

View File

@ -1847,7 +1847,7 @@ public final class DB
}
}
if (noIsSOTrxColumn)
log.log(Level.FINEST, TableName + " - No SOTrx");
if (log.isLoggable(Level.FINEST))log.log(Level.FINEST, TableName + " - No SOTrx");
return isSOTrx;
} // isSOTrx

View File

@ -434,7 +434,7 @@ public final class Msg
}
catch (ClassNotFoundException e)
{
s_log.log(Level.FINER, "Class not found: " + className);
if (s_log.isLoggable(Level.FINER))s_log.log(Level.FINER, "Class not found: " + className);
}
catch (Exception e)
{

View File

@ -179,7 +179,7 @@ public class Secure implements SecureInterface
return encString;
} catch (Exception ex) {
// log.log(Level.INFO, value, ex);
log.log(Level.INFO, "Problem encrypting string", ex);
if (log.isLoggable(Level.INFO))log.log(Level.INFO, "Problem encrypting string", ex);
}
// Fallback

View File

@ -136,7 +136,7 @@ public class Task extends Thread
}
catch (InterruptedException ie)
{
log.log(Level.INFO, "(ie) - " + ie);
if (log.isLoggable(Level.INFO))log.log(Level.INFO, "(ie) - " + ie);
}
// ExitValue
try

View File

@ -173,7 +173,7 @@ public class Trx
*/
public Connection getConnection(boolean createNew)
{
log.log(Level.ALL, "Active=" + isActive() + ", Connection=" + m_connection);
if (log.isLoggable(Level.ALL))log.log(Level.ALL, "Active=" + isActive() + ", Connection=" + m_connection);
if (m_connection == null) // get new Connection
{

View File

@ -264,8 +264,8 @@ public final class WebUtil
try
{
String dataEnc = new String(data.getBytes(enc), WebEnv.ENCODING);
log.log(Level.FINER, "Convert " + data + " (" + enc + ")-> "
+ dataEnc + " (" + WebEnv.ENCODING + ")");
if (log.isLoggable(Level.FINER))log.log(Level.FINER, "Convert " + data + " (" + enc + ")-> "
+ dataEnc + " (" + WebEnv.ENCODING + ")");
data = dataEnc;
}
catch (Exception e)

View File

@ -25,11 +25,11 @@ public class FileElementHandler implements ElementHandler {
TransformerHandler docHandler, int recordId) throws Exception {
PackoutDocument header = packout.getPackoutDocument();
PackoutItem detail = packout.getCurrentPackoutItem();
log.log(Level.INFO,
if (log.isLoggable(Level.INFO))log.log(Level.INFO,
"In PackOut.java handling Code or Other 2pack module creation");
String fileDirectory = packout.getPackoutDirectory() + header.getPackageName()
+ detail.getProperty(FileElementParameters.TARGET_DIRECTORY);
log.log(Level.INFO, "targetDirectory" + fileDirectory);
if (log.isLoggable(Level.INFO))log.log(Level.INFO, "targetDirectory" + fileDirectory);
String targetDirectory = null;
char fileseperator1 = '/';
char fileseperator2 = '\\';

View File

@ -80,11 +80,11 @@ public class LdapProcessor extends AdempiereServer
try
{
m_serverSocket = new ServerSocket(m_model.getLdapPort());
log.log(Level.INFO, "Opened Port=" + m_model.getLdapPort());
if (log.isLoggable(Level.INFO))log.log(Level.INFO, "Opened Port=" + m_model.getLdapPort());
while (!isInterrupted())
{
Socket socket = m_serverSocket.accept(); // waits for connection
log.log(Level.FINE, "Connection on Port=" + m_model.getLdapPort());
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Connection on Port=" + m_model.getLdapPort());
LdapConnectionHandler handler =
new LdapConnectionHandler (socket, m_model);
handler.start();

View File

@ -1497,7 +1497,7 @@ public final class Find extends CDialog
private Object parseString(GridField field, String in)
{
StringBuilder msglog = new StringBuilder("Parse: ").append(field).append(":").append(in);
log.log(Level.FINE, msglog.toString());
if (log.isLoggable(Level.FINE))log.log(Level.FINE, msglog.toString());
if (in == null)
return null;
int dt = field.getDisplayType();

View File

@ -142,7 +142,7 @@ public class POSKeyboard extends CDialog implements ActionListener, PosKeyListen
try {
text.commitEdit();
} catch (ParseException e1) {
log.log(Level.FINE, "JFormattedTextField commit failed");
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "JFormattedTextField commit failed");
}
}
else if ( action.equals(ConfirmPanel.A_CANCEL))
@ -155,7 +155,7 @@ public class POSKeyboard extends CDialog implements ActionListener, PosKeyListen
try {
field.commitEdit();
} catch (ParseException e1) {
log.log(Level.FINE, "JFormattedTextField commit failed");
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "JFormattedTextField commit failed");
}
dispose();
}
@ -242,7 +242,7 @@ public class POSKeyboard extends CDialog implements ActionListener, PosKeyListen
try {
text.commitEdit();
} catch (ParseException e) {
log.log(Level.FINE, "JFormattedTextField commit failed");
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "JFormattedTextField commit failed");
}
}
}

View File

@ -818,7 +818,7 @@ public class ProcessDialog extends Window implements EventListener<Event>, IProc
protected void doRun() {
try {
log.log(Level.INFO, "Process Info="+m_pi+" AD_Client_ID="+Env.getAD_Client_ID(Env.getCtx()));
if (log.isLoggable(Level.INFO))log.log(Level.INFO, "Process Info="+m_pi+" AD_Client_ID="+Env.getAD_Client_ID(Env.getCtx()));
WProcessCtl.process(ProcessDialog.this, m_WindowNo, parameterPanel, m_pi, null);
} finally {
Executions.schedule(getDesktop(), ProcessDialog.this, new Event(ON_COMPLETE, ProcessDialog.this, null));

View File

@ -505,7 +505,7 @@ public class ProcessModalDialog extends Window implements EventListener<Event>,
protected void doRun() {
try {
log.log(Level.INFO, "Process Info="+m_pi+" AD_Client_ID="+Env.getAD_Client_ID(Env.getCtx()));
if (log.isLoggable(Level.INFO))log.log(Level.INFO, "Process Info="+m_pi+" AD_Client_ID="+Env.getAD_Client_ID(Env.getCtx()));
WProcessCtl.process(ProcessModalDialog.this, m_WindowNo, parameterPanel, m_pi, null);
} finally {
Executions.schedule(getDesktop(), ProcessModalDialog.this, new Event(ON_COMPLETE, ProcessModalDialog.this, null));

View File

@ -300,7 +300,7 @@ public class LoginPanel extends Window implements EventListener<Event>
}
} catch (Exception e) {
//safe to ignore
logger.log(Level.INFO, e.getLocalizedMessage(), e);
if (logger.isLoggable(Level.INFO))logger.log(Level.INFO, e.getLocalizedMessage(), e);
}
}
});

View File

@ -131,7 +131,7 @@ public class OSTask extends Thread
}
catch (Exception ie)
{
log.log(Level.INFO, "(ie) - " + ie);
if (log.isLoggable(Level.INFO))log.log(Level.INFO, "(ie) - " + ie);
}
// ExitValue
log.config("done");

View File

@ -138,11 +138,11 @@ public class WTask extends Window implements EventListener<Event>
Executions.deactivate(desktop);
}
} catch (DesktopUnavailableException e) {
log.log(Level.FINE, e.getLocalizedMessage(), e);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, e.getLocalizedMessage(), e);
osTask.interrupt();
break;
} catch (InterruptedException e) {
log.log(Level.FINE, e.getLocalizedMessage(), e);
if (log.isLoggable(Level.FINE))log.log(Level.FINE, e.getLocalizedMessage(), e);
osTask.interrupt();
break;
}

View File

@ -1285,7 +1285,7 @@ public class DB_Oracle implements AdempiereDatabase
return false;
}
} catch (Exception e) {
log.log(Level.INFO, e.getLocalizedMessage(), e);
if (log.isLoggable(Level.INFO))log.log(Level.INFO, e.getLocalizedMessage(), e);
throw new DBException("Could not lock record for " + po.toString() + " caused by " + e.getLocalizedMessage());
} finally {
DB.close(rs, stmt);

View File

@ -350,7 +350,7 @@ public class DB_PostgreSQL implements AdempiereDatabase
if (!oraStatement.equals(retValue[0]) && retValue[0].indexOf("AD_Error") == -1)
{
//begin vpj-cd 24/06/2005 e-evolution
log.log(Level.FINE, "PostgreSQL =>" + retValue[0] + "<= <" + oraStatement + ">");
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "PostgreSQL =>" + retValue[0] + "<= <" + oraStatement + ">");
}
}
//end vpj-cd 24/06/2005 e-evolution
@ -1038,7 +1038,7 @@ public class DB_PostgreSQL implements AdempiereDatabase
return false;
}
} catch (Exception e) {
log.log(Level.INFO, e.getLocalizedMessage(), e);
if (log.isLoggable(Level.INFO))log.log(Level.INFO, e.getLocalizedMessage(), e);
throw new DBException("Could not lock record for " + po.toString() + " caused by " + e.getLocalizedMessage());
} finally {
try {

View File

@ -313,7 +313,7 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
if (X_WS_WebService_Para.PARAMETERTYPE_Constant.equals(para.getParameterType())) {
if (string == null || string.length() == 0) {
log.log(Level.INFO, "Web service type "
if (log.isLoggable(Level.INFO))log.log(Level.INFO, "Web service type "
+ m_webservicetype.getValue() + ": constant parameter "
+ parameterName + " set to "
+ para.getConstantValue());