poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gl...@apache.org
Subject cvs commit: jakarta-poi/src/java/org/apache/poi/util SystemOutLogger.java
Date Thu, 04 Sep 2003 03:47:25 GMT
glens       2003/09/03 20:47:25

  Modified:    src/java/org/apache/poi/util Tag: REL_2_BRANCH
                        SystemOutLogger.java
  Log:
  Fixed up some issues with the system out logger.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.2.2.1   +13 -6     jakarta-poi/src/java/org/apache/poi/util/SystemOutLogger.java
  
  Index: SystemOutLogger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/util/SystemOutLogger.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- SystemOutLogger.java	30 Apr 2003 04:39:09 -0000	1.2
  +++ SystemOutLogger.java	4 Sep 2003 03:47:25 -0000	1.2.2.1
  @@ -63,13 +63,12 @@
    * A logger class that strives to make it as easy as possible for
    * developers to write log calls, while simultaneously making those
    * calls as cheap as possible by performing lazy evaluation of the log
  - * message.<p>
  + * message.
    *
    * @author Marc Johnson (mjohnson at apache dot org)
    * @author Glen Stampoultzis (glens at apache.org)
    * @author Nicola Ken Barozzi (nicolaken at apache.org)
    */
  -
   public class SystemOutLogger extends POILogger
   {
       private String cat;
  @@ -88,19 +87,27 @@
   
       public void log(final int level, final Object obj1)
       {
  -        System.out.println("["+cat+"] "+obj1);
  +        if (check(level))
  +            System.out.println("["+cat+"] "+obj1);
       }
   
       /**
        * Check if a logger is enabled to log at the specified level
        *
        * @param level One of DEBUG, INFO, WARN, ERROR, FATAL
  -     * @param obj1 The logger to check.
  +     * @see #DEBUG
  +     * @see #INFO
  +     * @see #WARN
  +     * @see #ERROR
  +     * @see #FATAL
        */
  -
       public boolean check(final int level)
       {
  -       return true;
  +        int currentLevel = Integer.parseInt(System.getProperty("poi.log.level", WARN +
""));
  +        if (level >= currentLevel)
  +            return true;
  +        else
  +            return false;
       }
   
    
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-dev-help@jakarta.apache.org


Mime
View raw message