commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging SimpleLog.java
Date Mon, 21 Jan 2002 21:19:38 GMT
craigmcc    02/01/21 13:19:38

  Modified:    logging/src/java/org/apache/commons/logging SimpleLog.java
  Log:
  Add convenience "all" and "off" levels to SimpleLog.
  
  Revision  Changes    Path
  1.10      +15 -5     jakarta-commons/logging/src/java/org/apache/commons/logging/SimpleLog.java
  
  Index: SimpleLog.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/SimpleLog.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SimpleLog.java	17 Jan 2002 22:55:43 -0000	1.9
  +++ SimpleLog.java	21 Jan 2002 21:19:38 -0000	1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/SimpleLog.java,v
1.9 2002/01/17 22:55:43 rdonkin Exp $
  - * $Revision: 1.9 $
  - * $Date: 2002/01/17 22:55:43 $
  + * $Header: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/SimpleLog.java,v
1.10 2002/01/21 21:19:38 craigmcc Exp $
  + * $Revision: 1.10 $
  + * $Date: 2002/01/21 21:19:38 $
    *
    * ====================================================================
    *
  @@ -98,7 +98,7 @@
    * @author Rod Waldhoff
    * @author Robert Burrell Donkin
    *
  - * @version $Id: SimpleLog.java,v 1.9 2002/01/17 22:55:43 rdonkin Exp $
  + * @version $Id: SimpleLog.java,v 1.10 2002/01/21 21:19:38 craigmcc Exp $
    */
   public class SimpleLog implements Log {
   
  @@ -132,6 +132,11 @@
       /** "Fatal" level logging. */
       public static final int LOG_LEVEL_FATAL  = 5;
   
  +    /** Enable all logging levels */
  +    public static final int LOG_LEVEL_ALL    = (LOG_LEVEL_DEBUG - 1);
  +
  +    /** Enable no logging levels */
  +    public static final int LOG_LEVEL_OFF    = (LOG_LEVEL_FATAL + 1);
   
       // ------------------------------------------------------------ Initializer
   
  @@ -215,7 +220,9 @@
               lvl =  simpleLogProps.getProperty(systemPrefix + "defaultlog");
           }
   
  -        if("debug".equalsIgnoreCase(lvl)) {
  +        if("all".equalsIgnoreCase(lvl)) {
  +            setLevel(SimpleLog.LOG_LEVEL_ALL);
  +        } else if("debug".equalsIgnoreCase(lvl)) {
               setLevel(SimpleLog.LOG_LEVEL_DEBUG);
           } else if("info".equalsIgnoreCase(lvl)) {
               setLevel(SimpleLog.LOG_LEVEL_INFO);
  @@ -225,7 +232,10 @@
               setLevel(SimpleLog.LOG_LEVEL_ERROR);
           } else if("fatal".equalsIgnoreCase(lvl)) {
               setLevel(SimpleLog.LOG_LEVEL_FATAL);
  +        } else if("off".equalsIgnoreCase(lvl)) {
  +            setLevel(SimpleLog.LOG_LEVEL_OFF);
           }
  +
       }
   
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message