commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsi...@apache.org
Subject cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging/impl Jdk14Logger.java LogKitLogger.java
Date Wed, 17 Jul 2002 16:42:40 GMT
rsitze      2002/07/17 09:42:40

  Modified:    logging/src/java/org/apache/commons/logging/impl
                        Jdk14Logger.java LogKitLogger.java
  Log:
  bug 10480: handle null message without throwing NPE
  
  Revision  Changes    Path
  1.4       +16 -54    jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Jdk14Logger.java
  
  Index: Jdk14Logger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Jdk14Logger.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Jdk14Logger.java	6 May 2002 21:32:37 -0000	1.3
  +++ Jdk14Logger.java	17 Jul 2002 16:42:40 -0000	1.4
  @@ -133,9 +133,7 @@
        * Log a message with debug log level.
        */
       public void debug(Object message) {
  -
  -        log(Level.FINE, message.toString(), null);
  -
  +        log(Level.FINE, String.valueOf(message), null);
       }
   
   
  @@ -143,9 +141,7 @@
        * Log a message and exception with debug log level.
        */
       public void debug(Object message, Throwable exception) {
  -
  -        log(Level.FINE, message.toString(), exception);
  -
  +        log(Level.FINE, String.valueOf(message), exception);
       }
   
   
  @@ -153,9 +149,7 @@
        * Log a message with error log level.
        */
       public void error(Object message) {
  -
  -        log(Level.SEVERE, message.toString(), null);
  -
  +        log(Level.SEVERE, String.valueOf(message), null);
       }
   
   
  @@ -163,9 +157,7 @@
        * Log a message and exception with error log level.
        */
       public void error(Object message, Throwable exception) {
  -
  -        log(Level.SEVERE, message.toString(), exception);
  -
  +        log(Level.SEVERE, String.valueOf(message), exception);
       }
   
   
  @@ -173,9 +165,7 @@
        * Log a message with fatal log level.
        */
       public void fatal(Object message) {
  -
  -        log(Level.SEVERE, message.toString(), null);
  -
  +        log(Level.SEVERE, String.valueOf(message), null);
       }
   
   
  @@ -183,9 +173,7 @@
        * Log a message and exception with fatal log level.
        */
       public void fatal(Object message, Throwable exception) {
  -
  -        log(Level.SEVERE, message.toString(), exception);
  -
  +        log(Level.SEVERE, String.valueOf(message), exception);
       }
   
   
  @@ -193,9 +181,7 @@
        * Return the native Logger instance we are using.
        */
       public Logger getLogger() {
  -
           return (this.logger);
  -
       }
   
   
  @@ -203,9 +189,7 @@
        * Log a message with info log level.
        */
       public void info(Object message) {
  -
  -        log(Level.INFO, message.toString(), null);
  -
  +        log(Level.INFO, String.valueOf(message), null);
       }
   
   
  @@ -213,9 +197,7 @@
        * Log a message and exception with info log level.
        */
       public void info(Object message, Throwable exception) {
  -
  -        log(Level.INFO, message.toString(), exception);
  -
  +        log(Level.INFO, String.valueOf(message), exception);
       }
   
   
  @@ -223,9 +205,7 @@
        * Is debug logging currently enabled?
        */
       public boolean isDebugEnabled() {
  -
           return (logger.isLoggable(Level.FINE));
  -
       }
   
   
  @@ -233,9 +213,7 @@
        * Is error logging currently enabled?
        */
       public boolean isErrorEnabled() {
  -
           return (logger.isLoggable(Level.SEVERE));
  -
       }
   
   
  @@ -243,9 +221,7 @@
        * Is fatal logging currently enabled?
        */
       public boolean isFatalEnabled() {
  -
           return (logger.isLoggable(Level.SEVERE));
  -
       }
   
   
  @@ -253,9 +229,7 @@
        * Is info logging currently enabled?
        */
       public boolean isInfoEnabled() {
  -
           return (logger.isLoggable(Level.INFO));
  -
       }
   
   
  @@ -263,9 +237,7 @@
        * Is tace logging currently enabled?
        */
       public boolean isTraceEnabled() {
  -
           return (logger.isLoggable(Level.FINEST));
  -
       }
   
   
  @@ -273,9 +245,7 @@
        * Is warning logging currently enabled?
        */
       public boolean isWarnEnabled() {
  -
           return (logger.isLoggable(Level.WARNING));
  -
       }
   
   
  @@ -283,9 +253,7 @@
        * Log a message with trace log level.
        */
       public void trace(Object message) {
  -
  -        log(Level.FINEST, message.toString(), null);
  -
  +        log(Level.FINEST, String.valueOf(message), null);
       }
   
   
  @@ -293,9 +261,7 @@
        * Log a message and exception with trace log level.
        */
       public void trace(Object message, Throwable exception) {
  -
  -        log(Level.FINEST, message.toString(), exception);
  -
  +        log(Level.FINEST, String.valueOf(message), exception);
       }
   
   
  @@ -303,9 +269,7 @@
        * Log a message with warn log level.
        */
       public void warn(Object message) {
  -
  -        log(Level.WARNING, message.toString(), null);
  -
  +        log(Level.WARNING, String.valueOf(message), null);
       }
   
   
  @@ -313,9 +277,7 @@
        * Log a message and exception with warn log level.
        */
       public void warn(Object message, Throwable exception) {
  -
  -        log(Level.WARNING, message.toString(), exception);
  -
  +        log(Level.WARNING, String.valueOf(message), exception);
       }
   
   
  
  
  
  1.2       +14 -14    jakarta-commons/logging/src/java/org/apache/commons/logging/impl/LogKitLogger.java
  
  Index: LogKitLogger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/LogKitLogger.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LogKitLogger.java	3 Feb 2002 01:31:29 -0000	1.1
  +++ LogKitLogger.java	17 Jul 2002 16:42:40 -0000	1.2
  @@ -128,7 +128,7 @@
        */
       public void debug(Object message) {
           if (message != null) {
  -            logger.debug(message.toString());
  +            logger.debug(String.valueOf(message));
           }
       }
   
  @@ -138,7 +138,7 @@
        */
       public void debug(Object message, Throwable t) {
           if (message != null) {
  -            logger.debug(message.toString(), t);
  +            logger.debug(String.valueOf(message), t);
           }
       }
   
  @@ -148,7 +148,7 @@
        */
       public void info(Object message) {
           if (message != null) {
  -            logger.info(message.toString());
  +            logger.info(String.valueOf(message));
           }
       }
   
  @@ -158,7 +158,7 @@
        */
       public void info(Object message, Throwable t) {
           if (message != null) {
  -            logger.info(message.toString(), t);
  +            logger.info(String.valueOf(message), t);
           }
       }
   
  @@ -168,7 +168,7 @@
        */
       public void warn(Object message) {
           if (message != null) {
  -            logger.warn(message.toString());
  +            logger.warn(String.valueOf(message));
           }
       }
   
  @@ -178,7 +178,7 @@
        */
       public void warn(Object message, Throwable t) {
           if (message != null) {
  -            logger.warn(message.toString(), t);
  +            logger.warn(String.valueOf(message), t);
           }
       }
   
  @@ -188,7 +188,7 @@
        */
       public void error(Object message) {
           if (message != null) {
  -            logger.error(message.toString());
  +            logger.error(String.valueOf(message));
           }
       }
   
  @@ -198,7 +198,7 @@
        */
       public void error(Object message, Throwable t) {
           if (message != null) {
  -            logger.error(message.toString(), t);
  +            logger.error(String.valueOf(message), t);
           }
       }
   
  @@ -208,7 +208,7 @@
        */
       public void fatal(Object message) {
           if (message != null) {
  -            logger.fatalError(message.toString());
  +            logger.fatalError(String.valueOf(message));
           }
       }
   
  @@ -218,7 +218,7 @@
        */
       public void fatal(Object message, Throwable t) {
           if (message != null) {
  -            logger.fatalError(message.toString(), t);
  +            logger.fatalError(String.valueOf(message), t);
           }
       }
   
  
  
  

--
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