openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r1431649 - /openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
Date Thu, 10 Jan 2013 21:16:14 GMT
Author: ppoddar
Date: Thu Jan 10 21:16:14 2013
New Revision: 1431649

URL: http://svn.apache.org/viewvc?rev=1431649&view=rev
Log:
OPENJPA-2321: Remove synchrnization on output stream

Modified:
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java?rev=1431649&r1=1431648&r2=1431649&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
(original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java
Thu Jan 10 21:16:14 2013
@@ -302,24 +302,21 @@ public class LogFactoryImpl 
 
         protected void log(short level, String message, Throwable t) {
             String msg = formatMessage(level, message, t);
-            synchronized (_out) {
-                _out.print(msg);
-            }
+            _out.println(msg);
         }
 
         /**
          * Convert <code>message</code> into a string ready to be written to
-         * the log. The string should include the terminating newline.
+         * the log. 
          *
          * @param t may be null
          */
-        protected String formatMessage(short level, String message,
-            Throwable t) {
+        protected String formatMessage(short level, String message, Throwable t) {
             // we write to a StringBuilder and then flush it all at
             // once as a single line, since some environments(e.g., JBoss)
             // override the System output stream to flush any calls
             // to write without regard to line breaks, making the
-            // output incomprehensibe.
+            // output incomprehensible.
             StringBuilder buf = new StringBuilder();
 
             buf.append(getOffset());
@@ -335,7 +332,6 @@ public class LogFactoryImpl 
             buf.append(_channel);
             buf.append(" - ");
             buf.append(message);
-            buf.append(NEWLINE);
 
             if (t != null) {
                 StringWriter swriter = new StringWriter();



Mime
View raw message