You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2012/05/11 06:46:27 UTC

svn commit: r1337024 - in /ofbiz/trunk: applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/ framework/base/src/org/ofbiz/base/util/ framework/webapp/src/org/ofbiz/webapp/event/ specialpurpose/shark/src/org/ofbiz/shark/audit/ spec...

Author: ashish
Date: Fri May 11 04:46:26 2012
New Revision: 1337024

URL: http://svn.apache.org/viewvc?rev=1337024&view=rev
Log:
Applied similar fix as we did on trunk r1300463.
On production systems you can't suppress Debug.log( message by the use of debug.properties file. It is always good to use Debug.* statements that are having log level setup in debug.properties file. The real problem comes with Debug.log( statement when you are printing any list or map object that contains so many records(or data) in it. Here I am changing all the occurrence of Debug.log( with Debug.logInfo(, Debug.logError( or Debug.logWarning( so that we can have better control of Debug.* statements on production system. :-)

Bad use of Debug statement. On production system you will get false alarm that you are having error in code base although the resultant statement is only giving additional information instead of error message.

If conditional check is used for some debug level lets say "Verbose" then the containing Debug statement will be Debug.logVerbose() instead of Debug.logInfo() - Comment from Jacopo and Adrian. 

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java
    ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java
    ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java?rev=1337024&r1=1337023&r2=1337024&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java Fri May 11 04:46:26 2012
@@ -703,7 +703,7 @@ public class CCPaymentServices {
 
         Map<String, Object> pbOrder = UtilGenerics.checkMap(context.get("pbOrder"));
         if (pbOrder != null) {
-            if (Debug.verboseOn()) Debug.logInfo("pbOrder Map not empty:" + pbOrder.toString(),module);
+            if (Debug.verboseOn()) Debug.logVerbose("pbOrder Map not empty:" + pbOrder.toString(),module);
             Element pbOrderElement =  UtilXml.addChildElement(orderFormDocElement, "PbOrder", requestDocument); // periodic billing order
             UtilXml.addChildElementValue(pbOrderElement, "OrderFrequencyCycle", (String) pbOrder.get("OrderFrequencyCycle"), requestDocument);
             Element interval = UtilXml.addChildElementValue(pbOrderElement, "OrderFrequencyInterval", (String) pbOrder.get("OrderFrequencyInterval"), requestDocument);

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java?rev=1337024&r1=1337023&r2=1337024&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java Fri May 11 04:46:26 2012
@@ -361,7 +361,7 @@ public class HttpClient {
                 }
             }
 
-            if (Debug.verboseOn() || debug) Debug.logInfo("Content-Type: " + contentType, module);
+            if (Debug.verboseOn() || debug) Debug.logVerbose("Content-Type: " + contentType, module);
 
             if (contentType != null) {
                 contentType = contentType.toUpperCase();
@@ -374,15 +374,15 @@ public class HttpClient {
                 }
 
                 if (charset != null) charset = charset.trim();
-                if (Debug.verboseOn() || debug) Debug.logInfo("Getting text from HttpClient with charset: " + charset, module);
+                if (Debug.verboseOn() || debug) Debug.logVerbose("Getting text from HttpClient with charset: " + charset, module);
             }
 
             BufferedReader post = new BufferedReader(charset == null ? new InputStreamReader(in) : new InputStreamReader(in, charset));
             String line = "";
 
-            if (Debug.verboseOn() || debug) Debug.logInfo("---- HttpClient Response Content ----", module);
+            if (Debug.verboseOn() || debug) Debug.logVerbose("---- HttpClient Response Content ----", module);
             while ((line = post.readLine()) != null) {
-                if (Debug.verboseOn() || debug) Debug.logInfo("[HttpClient] : " + line, module);
+                if (Debug.verboseOn() || debug) Debug.logVerbose("[HttpClient] : " + line, module);
                 buf.append(line);
                 if (lineFeed) {
                     buf.append("\n");
@@ -432,11 +432,11 @@ public class HttpClient {
             } else {
                 con = URLConnector.openConnection(requestUrl, timeout, clientCertAlias, hostVerification);
             }
-            if (Debug.verboseOn() || debug) Debug.logInfo("Connection opened to : " + requestUrl.toExternalForm(), module);
+            if (Debug.verboseOn() || debug) Debug.logVerbose("Connection opened to : " + requestUrl.toExternalForm(), module);
 
             if ((con instanceof HttpURLConnection)) {
                 ((HttpURLConnection) con).setInstanceFollowRedirects(followRedirects);
-                if (Debug.verboseOn() || debug) Debug.logInfo("Connection is of type HttpURLConnection, more specifically: " + con.getClass().getName(), module);
+                if (Debug.verboseOn() || debug) Debug.logVerbose("Connection is of type HttpURLConnection, more specifically: " + con.getClass().getName(), module);
             }
 
             // set the content type
@@ -462,7 +462,7 @@ public class HttpClient {
             if (basicAuthUsername != null) {
                 String basicAuthString = "Basic " + Base64.base64Encode(basicAuthUsername + ":" + (basicAuthPassword == null ? "" : basicAuthPassword));
                 con.setRequestProperty("Authorization", basicAuthString);
-                if (Debug.verboseOn() || debug) Debug.logInfo("Header - Authorization: " + basicAuthString, module);
+                if (Debug.verboseOn() || debug) Debug.logVerbose("Header - Authorization: " + basicAuthString, module);
             }
 
             if (UtilValidate.isNotEmpty(headers)) {
@@ -470,22 +470,22 @@ public class HttpClient {
                     String headerName = entry.getKey();
                     String headerValue = entry.getValue();
                     con.setRequestProperty(headerName, headerValue);
-                    if (Debug.verboseOn() || debug) Debug.logInfo("Header - " + headerName + ": " + headerValue, module);
+                    if (Debug.verboseOn() || debug) Debug.logVerbose("Header - " + headerName + ": " + headerValue, module);
                 }
             }
 
             if (method.equalsIgnoreCase("post")) {
                 OutputStreamWriter out = new OutputStreamWriter(con.getOutputStream(), this.streamCharset != null ? this.streamCharset : "UTF-8");
-                if (Debug.verboseOn() || debug) Debug.logInfo("Opened output stream", module);
+                if (Debug.verboseOn() || debug) Debug.logVerbose("Opened output stream", module);
 
                 if (arguments != null) {
                     out.write(arguments);
-                    if (Debug.verboseOn() || debug) Debug.logInfo("Wrote arguements (parameters) : " + arguments, module);
+                    if (Debug.verboseOn() || debug) Debug.logVerbose("Wrote arguements (parameters) : " + arguments, module);
                 }
 
                 out.flush();
                 out.close();
-                if (Debug.verboseOn() || debug) Debug.logInfo("Flushed and closed buffer", module);
+                if (Debug.verboseOn() || debug) Debug.logVerbose("Flushed and closed buffer", module);
             }
 
             if (Debug.verboseOn() || debug) {

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java?rev=1337024&r1=1337023&r2=1337024&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java Fri May 11 04:46:26 2012
@@ -247,7 +247,7 @@ public class ServiceEventHandler impleme
             if (UtilValidate.isNotEmpty(modelParam.stringMapPrefix)) {
                 Map<String, Object> paramMap = UtilHttp.makeParamMapWithPrefix(request, multiPartMap, modelParam.stringMapPrefix, null);
                 value = paramMap;
-                if (Debug.verboseOn()) Debug.logInfo("Set [" + modelParam.name + "]: " + paramMap, module);
+                if (Debug.verboseOn()) Debug.logVerbose("Set [" + modelParam.name + "]: " + paramMap, module);
             } else if (UtilValidate.isNotEmpty(modelParam.stringListSuffix)) {
                 List<Object> paramList = UtilHttp.makeParamListWithSuffix(request, multiPartMap, modelParam.stringListSuffix, null);
                 value = paramList;

Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java?rev=1337024&r1=1337023&r2=1337024&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java Fri May 11 04:46:26 2012
@@ -151,23 +151,23 @@ public class EntityAuditMgr implements E
         processHistory.addAll(getCreateProcessEvents(processId));
         processHistory.addAll(getProcessDataEvents(processId));
         processHistory.addAll(getProcessStateEvents(processId));
-        if (Debug.verboseOn()) Debug.logInfo(":: restoreProcessHistory :: " + processHistory.size(), module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: restoreProcessHistory :: " + processHistory.size(), module);
         return processHistory;
     }
 
     public List restoreActivityHistory(String processId, String activityId, SharkTransaction trans) throws EventAuditException {
-        if (Debug.verboseOn()) Debug.logInfo(":: restoreActivityHistory ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: restoreActivityHistory ::", module);
         List activityHistory = new ArrayList();
         activityHistory.addAll(getAssignmentEvents(processId, activityId));
         activityHistory.addAll(getActivityDataEvents(processId, activityId));
         activityHistory.addAll(getActivityStateEvents(processId, activityId));
-        if (Debug.verboseOn()) Debug.logInfo(":: restoreActivityHistory :: " + activityHistory.size(), module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: restoreActivityHistory :: " + activityHistory.size(), module);
         return activityHistory;
     }
 
     // process history
     private List getCreateProcessEvents(String processId) throws EventAuditException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getCreateProcessEvents ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getCreateProcessEvents ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List createProcessEvents = new ArrayList();
         List lookupList = null;
@@ -190,7 +190,7 @@ public class EntityAuditMgr implements E
     }
 
     private List getProcessStateEvents(String processId) throws EventAuditException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getProcessStateEvents ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getProcessStateEvents ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List stateEvents = new ArrayList();
         List lookupList = null;
@@ -213,7 +213,7 @@ public class EntityAuditMgr implements E
     }
 
     private List getProcessDataEvents(String processId) throws EventAuditException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getProcessDataEvents ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getProcessDataEvents ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List dataEvents = new ArrayList();
         List lookupList = null;
@@ -237,7 +237,7 @@ public class EntityAuditMgr implements E
 
     // activity history
     private List getAssignmentEvents(String processId, String activityId) throws EventAuditException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getAssignmentEvents ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getAssignmentEvents ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List assignmentEvents = new ArrayList();
         List lookupList = null;
@@ -260,7 +260,7 @@ public class EntityAuditMgr implements E
     }
 
     private List getActivityStateEvents(String processId, String activityId) throws EventAuditException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getActivityStateEvents ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getActivityStateEvents ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List stateEvents = new ArrayList();
         List lookupList = null;
@@ -283,7 +283,7 @@ public class EntityAuditMgr implements E
     }
 
     private List getActivityDataEvents(String processId, String activityId) throws EventAuditException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getActivityDataEvents ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getActivityDataEvents ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List dataEvents = new ArrayList();
         List lookupList = null;

Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java?rev=1337024&r1=1337023&r2=1337024&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java (original)
+++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java Fri May 11 04:46:26 2012
@@ -176,7 +176,7 @@ public class EntityPersistentMgr impleme
     }
 
     public boolean restore(ProcessVariablePersistenceInterface processVariablePersistenceInterface, SharkTransaction trans) throws PersistenceException {
-        if (Debug.verboseOn()) Debug.logInfo(":: ProcessVariablePersistenceInterface ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: ProcessVariablePersistenceInterface ::", module);
         if (processVariablePersistenceInterface == null) {
             return false;
         }
@@ -190,7 +190,7 @@ public class EntityPersistentMgr impleme
     }
 
     public boolean restore(ActivityVariablePersistenceInterface activityVariablePersistenceInterface, SharkTransaction trans) throws PersistenceException {
-        if (Debug.verboseOn()) Debug.logInfo(":: ActivityVariablePersistenceInterface ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: ActivityVariablePersistenceInterface ::", module);
         if (activityVariablePersistenceInterface == null) {
             return false;
         }
@@ -352,7 +352,7 @@ public class EntityPersistentMgr impleme
     }
 
     public List getAllProcessMgrs(SharkTransaction trans) throws PersistenceException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getAllProcessMgrs ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getAllProcessMgrs ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List createdList = new ArrayList();
         List lookupList = null;
@@ -382,7 +382,7 @@ public class EntityPersistentMgr impleme
     }
 
     public List getAllResources(SharkTransaction trans) throws PersistenceException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getAllResources ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getAllResources ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List createdList = new ArrayList();
         List lookupList = null;
@@ -402,7 +402,7 @@ public class EntityPersistentMgr impleme
     }
 
     public List getAllAssignments(SharkTransaction trans) throws PersistenceException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getAllAssignments ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getAllAssignments ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List createdList = new ArrayList();
         List lookupList = null;
@@ -421,7 +421,7 @@ public class EntityPersistentMgr impleme
         return createdList;
     }
     public List getAllActivities(SharkTransaction trans) throws PersistenceException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getAllActivities ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getAllActivities ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List createdList = new ArrayList();
         List lookupList = null;
@@ -441,12 +441,12 @@ public class EntityPersistentMgr impleme
     }
 
     public List getAllProcessesForMgr(String mgrName, SharkTransaction trans) throws PersistenceException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getAllProcessesForMgr ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getAllProcessesForMgr ::", module);
         return this.getProcessesForMgr(mgrName, null, trans);
     }
 
     public List getProcessesForMgr(String mgrName, String state, SharkTransaction trans) throws PersistenceException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getProcessesForMgr ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getProcessesForMgr ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List createdList = new ArrayList();
         List lookupList = null;
@@ -681,7 +681,7 @@ public class EntityPersistentMgr impleme
     }
 
     public List getAllVariablesForProcess(String processId, SharkTransaction trans) throws PersistenceException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getAllVariablesForProcess ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getAllVariablesForProcess ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List createdList = new ArrayList();
         List lookupList = null;
@@ -701,13 +701,13 @@ public class EntityPersistentMgr impleme
         } else {
             Debug.logInfo("Lookup list empty", module);
         }
-        if (Debug.verboseOn()) Debug.logInfo("Returning list : " + createdList.size(), module);
+        if (Debug.verboseOn()) Debug.logVerbose("Returning list : " + createdList.size(), module);
         return createdList;
     }
 
     public List getAllVariablesForActivity(String activityId, SharkTransaction trans) throws PersistenceException {
 
-        if (Debug.verboseOn()) Debug.logInfo(":: getAllVariablesForActivity ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getAllVariablesForActivity ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List createdList = new ArrayList();
         List lookupList = null;
@@ -1003,7 +1003,7 @@ public class EntityPersistentMgr impleme
         return returnList;
     }
     public List getAllProcesses(SharkTransaction trans) throws PersistenceException {
-        if (Debug.verboseOn()) Debug.logInfo(":: getAllProcesses ::", module);
+        if (Debug.verboseOn()) Debug.logVerbose(":: getAllProcesses ::", module);
         Delegator delegator = SharkContainer.getDelegator();
         List createdList = new ArrayList();
         List lookupList = null;



Re: svn commit: r1337024 - in /ofbiz/trunk: applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/ framework/base/src/org/ofbiz/base/util/ framework/webapp/src/org/ofbiz/webapp/event/ specialpurpose/shark/src/org/ofbiz/shark/audit/ spec

Posted by Jacques Le Roux <ja...@les7arts.com>.
Ashish is already aware, Adrian noticed it.  I guess,  Ashish will not revert but use the right corresponding level...

Jacques
PS: top posted because closing the thread

From: "Adam Heath" <do...@brainfood.com>
> On 05/10/2012 11:46 PM, ashish@apache.org wrote:
>> Author: ashish
>> Date: Fri May 11 04:46:26 2012
>> New Revision: 1337024
>>
>> URL: http://svn.apache.org/viewvc?rev=1337024&view=rev
>> Log:
>> Applied similar fix as we did on trunk r1300463.
>> On production systems you can't suppress Debug.log( message by the use of debug.properties file. It is always good to use Debug.* 
>> statements that are having log level setup in debug.properties file. The real problem comes with Debug.log( statement when you 
>> are printing any list or map object that contains so many records(or data) in it. Here I am changing all the occurrence of 
>> Debug.log( with Debug.logInfo(, Debug.logError( or Debug.logWarning( so that we can have better control of Debug.* statements on 
>> production system. :-)
>>
>> Bad use of Debug statement. On production system you will get false alarm that you are having error in code base although the 
>> resultant statement is only giving additional information instead of error message.
>>
>> If conditional check is used for some debug level lets say "Verbose" then the containing Debug statement will be 
>> Debug.logVerbose() instead of Debug.logInfo() - Comment from Jacopo and Adrian.
>>
>> Modified:
>>      ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java
>>      ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java
>>      ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java
>>      ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java
>>      ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java
>>
>> Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java
>> URL: 
>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java?rev=1337024&r1=1337023&r2=1337024&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java (original)
>> +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java Fri May 11 
>> 04:46:26 2012
>> @@ -703,7 +703,7 @@ public class CCPaymentServices {
>>
>>           Map<String, Object>  pbOrder = UtilGenerics.checkMap(context.get("pbOrder"));
>>           if (pbOrder != null) {
>> -            if (Debug.verboseOn()) Debug.logInfo("pbOrder Map not empty:" + pbOrder.toString(),module);
>> +            if (Debug.verboseOn()) Debug.logVerbose("pbOrder Map not empty:" + pbOrder.toString(),module);
>>               Element pbOrderElement =  UtilXml.addChildElement(orderFormDocElement, "PbOrder", requestDocument); // periodic 
>> billing order
>>               UtilXml.addChildElementValue(pbOrderElement, "OrderFrequencyCycle", (String) pbOrder.get("OrderFrequencyCycle"), 
>> requestDocument);
>>               Element interval = UtilXml.addChildElementValue(pbOrderElement, "OrderFrequencyInterval", (String) 
>> pbOrder.get("OrderFrequencyInterval"), requestDocument);
>>
>> Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java
>> URL: 
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java?rev=1337024&r1=1337023&r2=1337024&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java (original)
>> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java Fri May 11 04:46:26 2012
>> @@ -361,7 +361,7 @@ public class HttpClient {
>>                   }
>>               }
>>
>> -            if (Debug.verboseOn() || debug) Debug.logInfo("Content-Type: " + contentType, module);
>> +            if (Debug.verboseOn() || debug) Debug.logVerbose("Content-Type: " + contentType, module);
>
> Er, no.  The '|| debug' means that this is not a normal situation. Don't change it in this case.
>
> (there are other similar changes that I removed from the email, please revert) 

Re: svn commit: r1337024 - in /ofbiz/trunk: applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/ framework/base/src/org/ofbiz/base/util/ framework/webapp/src/org/ofbiz/webapp/event/ specialpurpose/shark/src/org/ofbiz/shark/audit/ spec...

Posted by Adam Heath <do...@brainfood.com>.
On 05/10/2012 11:46 PM, ashish@apache.org wrote:
> Author: ashish
> Date: Fri May 11 04:46:26 2012
> New Revision: 1337024
>
> URL: http://svn.apache.org/viewvc?rev=1337024&view=rev
> Log:
> Applied similar fix as we did on trunk r1300463.
> On production systems you can't suppress Debug.log( message by the use of debug.properties file. It is always good to use Debug.* statements that are having log level setup in debug.properties file. The real problem comes with Debug.log( statement when you are printing any list or map object that contains so many records(or data) in it. Here I am changing all the occurrence of Debug.log( with Debug.logInfo(, Debug.logError( or Debug.logWarning( so that we can have better control of Debug.* statements on production system. :-)
>
> Bad use of Debug statement. On production system you will get false alarm that you are having error in code base although the resultant statement is only giving additional information instead of error message.
>
> If conditional check is used for some debug level lets say "Verbose" then the containing Debug statement will be Debug.logVerbose() instead of Debug.logInfo() - Comment from Jacopo and Adrian.
>
> Modified:
>      ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java
>      ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java
>      ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceEventHandler.java
>      ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/audit/EntityAuditMgr.java
>      ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java
>
> Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java?rev=1337024&r1=1337023&r2=1337024&view=diff
> ==============================================================================
> --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java (original)
> +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java Fri May 11 04:46:26 2012
> @@ -703,7 +703,7 @@ public class CCPaymentServices {
>
>           Map<String, Object>  pbOrder = UtilGenerics.checkMap(context.get("pbOrder"));
>           if (pbOrder != null) {
> -            if (Debug.verboseOn()) Debug.logInfo("pbOrder Map not empty:" + pbOrder.toString(),module);
> +            if (Debug.verboseOn()) Debug.logVerbose("pbOrder Map not empty:" + pbOrder.toString(),module);
>               Element pbOrderElement =  UtilXml.addChildElement(orderFormDocElement, "PbOrder", requestDocument); // periodic billing order
>               UtilXml.addChildElementValue(pbOrderElement, "OrderFrequencyCycle", (String) pbOrder.get("OrderFrequencyCycle"), requestDocument);
>               Element interval = UtilXml.addChildElementValue(pbOrderElement, "OrderFrequencyInterval", (String) pbOrder.get("OrderFrequencyInterval"), requestDocument);
>
> Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java?rev=1337024&r1=1337023&r2=1337024&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java (original)
> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/HttpClient.java Fri May 11 04:46:26 2012
> @@ -361,7 +361,7 @@ public class HttpClient {
>                   }
>               }
>
> -            if (Debug.verboseOn() || debug) Debug.logInfo("Content-Type: " + contentType, module);
> +            if (Debug.verboseOn() || debug) Debug.logVerbose("Content-Type: " + contentType, module);

Er, no.  The '|| debug' means that this is not a normal situation. 
Don't change it in this case.

(there are other similar changes that I removed from the email, please 
revert)