User: starksm 
  Date: 01/12/28 20:35:47

  Modified:    src/main/org/jboss/jms/ra Tag: Branch_2_4 JmsLogger.java
  Log:
  Use CategoryWriter by default
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.4.3   +42 -36    jboss/src/main/org/jboss/jms/ra/JmsLogger.java
  
  Index: JmsLogger.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/ra/JmsLogger.java,v
  retrieving revision 1.1.4.2
  retrieving revision 1.1.4.3
  diff -u -r1.1.4.2 -r1.1.4.3
  --- JmsLogger.java    2001/08/24 11:54:20     1.1.4.2
  +++ JmsLogger.java    2001/12/29 04:35:47     1.1.4.3
  @@ -5,12 +5,12 @@
    * modify it under the terms of the GNU Lesser General Public
    * License as published by the Free Software Foundation; either
    * version 2 of the License, or (at your option) any later version
  - * 
  + *
    * This library is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    * Lesser General Public License for more details.
  - * 
  + *
    * You should have received a copy of the GNU Lesser General Public
    * License along with this library; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  @@ -19,6 +19,9 @@
   
   import java.io.PrintWriter;
   
  +import org.apache.log4j.Category;
  +import org.jboss.logging.log4j.CategoryWriter;
  +
   /**
    * JmsLogger.java
    *
  @@ -26,40 +29,43 @@
    * Created: Tue Apr 17 21:21:49 2001
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Peter Antman</a>.
  - * @version $Revision: 1.1.4.2 $
  + * @version $Revision: 1.1.4.3 $
    */
  -
  -public class JmsLogger  {
  -    private PrintWriter logWriter = null;
  -    private boolean isOn = true;
  -    private Level logLevel = Level.ALL;
  -    
  -    public JmsLogger() {
  -     logWriter = new PrintWriter(System.out);
  -
  -    }
  -    
  -    public void setLogWriter(PrintWriter out) {
  -     this.logWriter = out;
  -     this.log(Level.FINE, "Setting LogWriter: " + out);
  -    }
  -
  -    public void setLogging(boolean log) {
  -     isOn = log;
  -    }
  -
  -    public void setLogLevel(String level) {
  -     logLevel = Level.parse(level);
  -    }
  -
  -    public void log(Level level, String message) {
  -     if(isOn && logLevel.intValue() >= level.intValue()) {
  -         logWriter.println(level.toString() + ": " + message);
  -         logWriter.flush();
  -     }
  -    }
  -    
  -
  -    
  +public class JmsLogger
  +{
  +   private PrintWriter logWriter = null;
  +   private boolean isOn = true;
  +   private Level logLevel = Level.ALL;
  +
  +   public JmsLogger()
  +   {
  +      Category cat = Category.getInstance(JmsLogger.class);
  +      logWriter = new CategoryWriter(cat);
  +   }
  +
  +   public void setLogWriter(PrintWriter out)
  +   {
  +      this.logWriter = out;
  +      this.log(Level.FINE, "Setting LogWriter: " + out);
  +   }
  +
  +   public void setLogging(boolean log)
  +   {
  +      isOn = log;
  +   }
  +   
  +   public void setLogLevel(String level)
  +   {
  +      logLevel = Level.parse(level);
  +   }
  +   
  +   public void log(Level level, String message)
  +   {
  +      if(isOn && logLevel.intValue() >= level.intValue())
  +      {
  +         logWriter.println(level.toString() + ": " + message);
  +         logWriter.flush();
  +      }
  +   }
   
   } // JmsLogger
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to