axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whitl...@apache.org
Subject cvs commit: xml-axis-wsif/java/src/org/apache/wsif/logging MessageLogger.java Trc.java
Date Fri, 26 Jul 2002 09:37:18 GMT
whitlock    2002/07/26 02:37:18

  Modified:    java/src/org/apache/wsif/logging MessageLogger.java Trc.java
  Log:
  Add isXxxxEnabled() methods
  
  Revision  Changes    Path
  1.5       +30 -8     xml-axis-wsif/java/src/org/apache/wsif/logging/MessageLogger.java
  
  Index: MessageLogger.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/logging/MessageLogger.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MessageLogger.java	19 Jul 2002 15:46:31 -0000	1.4
  +++ MessageLogger.java	26 Jul 2002 09:37:18 -0000	1.5
  @@ -82,6 +82,22 @@
       	Trc.entry(this);
       	Trc.exit();
       }
  +    
  +    public static boolean isInfoEnabled() {
  +        return log.isInfoEnabled();
  +    }
  +
  +    public static boolean isWarnEnabled() {
  +        return log.isWarnEnabled();
  +    }
  +
  +    public static boolean isErrorEnabled() {
  +        return log.isErrorEnabled();
  +    }
  +
  +    public static boolean isFatalEnabled() {
  +        return log.isFatalEnabled();
  +    }
   
       public static void log(String key) {
       	Trc.entry(null,key);
  @@ -177,14 +193,20 @@
       }
   
       private static void logIt(char severity, String text) {
  -        if (severity == 'I')
  -            log.info(text);
  -        else if (severity == 'W')
  -            log.warn(text);
  -        else if (severity == 'F')
  -            log.fatal(text);
  -        else // default is error (shouldn't happen)
  -            log.error(text);
  +        if (severity == 'I') {
  +            if (isInfoEnabled())
  +                log.info(text);
  +        } else if (severity == 'W') {
  +            if (isWarnEnabled())
  +                log.warn(text);
  +        } else if (severity == 'F') {
  +            if (isFatalEnabled())
  +                log.fatal(text);
  +        } else {
  +            // default is error 
  +            if (isErrorEnabled())
  +                log.error(text);
  +        }
       }
   
       private static void handleMissingResourceException(
  
  
  
  1.3       +8 -0      xml-axis-wsif/java/src/org/apache/wsif/logging/Trc.java
  
  Index: Trc.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/logging/Trc.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Trc.java	24 Jul 2002 13:28:31 -0000	1.2
  +++ Trc.java	26 Jul 2002 09:37:18 -0000	1.3
  @@ -91,6 +91,14 @@
       private Trc() {
           super();
       }
  +    
  +    public static boolean isTraceEnabled() {
  +        return log.isTraceEnabled();
  +    }
  +
  +    public static boolean isDebugEnabled() {
  +        return log.isDebugEnabled();
  +    }
   
       /**
        * Traces entry into a method with no parameters.
  
  
  

Mime
View raw message