Coverage Report - org.mule.util.MuleLogger
 
Classes in this File Line Coverage Branch Coverage Complexity
MuleLogger
0%
0/49
0%
0/6
1.16
 
 1  
 /*
 2  
  * $Id: MuleLogger.java 8077 2007-08-27 20:15:25Z aperepel $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.util;
 12  
 
 13  
 import java.util.Arrays;
 14  
 import java.util.List;
 15  
 
 16  
 import org.apache.commons.logging.Log;
 17  
 
 18  
 /**
 19  
  * A {@link Log} wrapper that supports boilerplate logging for high impact messages
 20  
  */
 21  
 // @Immutable
 22  
 public class MuleLogger implements Log
 23  
 {
 24  
     private final Log logger;
 25  
 
 26  
     public MuleLogger(Log logger)
 27  0
     {
 28  0
         if (logger == null)
 29  
         {
 30  0
             throw new IllegalArgumentException("logger may not be null");
 31  
         }
 32  
 
 33  0
         this.logger = logger;
 34  0
     }
 35  
 
 36  
     public boolean isDebugEnabled()
 37  
     {
 38  0
         return logger.isDebugEnabled();
 39  
     }
 40  
 
 41  
     public boolean isErrorEnabled()
 42  
     {
 43  0
         return logger.isErrorEnabled();
 44  
     }
 45  
 
 46  
     public boolean isFatalEnabled()
 47  
     {
 48  0
         return logger.isFatalEnabled();
 49  
     }
 50  
 
 51  
     public boolean isInfoEnabled()
 52  
     {
 53  0
         return logger.isInfoEnabled();
 54  
     }
 55  
 
 56  
     public boolean isTraceEnabled()
 57  
     {
 58  0
         return logger.isTraceEnabled();
 59  
     }
 60  
 
 61  
     public boolean isWarnEnabled()
 62  
     {
 63  0
         return logger.isWarnEnabled();
 64  
     }
 65  
 
 66  
     public void trace(Object o)
 67  
     {
 68  0
         logger.trace(o);
 69  0
     }
 70  
 
 71  
     public void trace(Object o, Throwable throwable)
 72  
     {
 73  0
         logger.trace(o, throwable);
 74  0
     }
 75  
 
 76  
     public void debug(Object o)
 77  
     {
 78  0
         logger.debug(o);
 79  0
     }
 80  
 
 81  
     public void debug(Object o, Throwable throwable)
 82  
     {
 83  0
         logger.debug(o, throwable);
 84  0
     }
 85  
 
 86  
     public void info(Object o)
 87  
     {
 88  0
         logger.info(o);
 89  0
     }
 90  
 
 91  
     public void info(Object o, Throwable throwable)
 92  
     {
 93  0
         logger.info(o, throwable);
 94  0
     }
 95  
 
 96  
     public void warn(Object o)
 97  
     {
 98  0
         logger.warn(o);
 99  0
     }
 100  
 
 101  
     public void warn(Object o, Throwable throwable)
 102  
     {
 103  0
         logger.warn(o, throwable);
 104  0
     }
 105  
 
 106  
     public void error(Object o)
 107  
     {
 108  0
         logger.error(o);
 109  0
     }
 110  
 
 111  
     public void error(Object o, Throwable throwable)
 112  
     {
 113  0
         logger.error(o, throwable);
 114  0
     }
 115  
 
 116  
     public void fatal(Object o)
 117  
     {
 118  0
         logger.fatal(o);
 119  0
     }
 120  
 
 121  
     public void fatal(Object o, Throwable throwable)
 122  
     {
 123  0
         logger.fatal(o, throwable);
 124  0
     }
 125  
 
 126  
     public void boilerPlate(String message)
 127  
     {
 128  0
         boilerPlate(message, '*', StringMessageUtils.DEFAULT_MESSAGE_WIDTH);
 129  0
     }
 130  
 
 131  
     public void logBoilerPlate(List messages)
 132  
     {
 133  0
         boilerPlate(messages, '*', StringMessageUtils.DEFAULT_MESSAGE_WIDTH);
 134  0
     }
 135  
 
 136  
     public void logBoilerPlate(String[] messages)
 137  
     {
 138  0
         boilerPlate(Arrays.asList(messages), '*', StringMessageUtils.DEFAULT_MESSAGE_WIDTH);
 139  0
     }
 140  
 
 141  
     public void boilerPlate(String message, char c, int maxlength)
 142  
     {
 143  0
         if (logger.isInfoEnabled())
 144  
         {
 145  0
             logger.info("\n" + StringMessageUtils.getBoilerPlate(message, c, maxlength));
 146  
         }
 147  0
     }
 148  
 
 149  
     public void boilerPlate(List messages, char c, int maxlength)
 150  
     {
 151  0
         if (logger.isInfoEnabled())
 152  
         {
 153  0
             logger.info("\n" + StringMessageUtils.getBoilerPlate(messages, c, maxlength));
 154  
         }
 155  0
     }
 156  
 
 157  
     public void boilerPlate(String[] messages, char c, int maxlength)
 158  
     {
 159  0
         boilerPlate(Arrays.asList(messages), c, maxlength);
 160  0
     }
 161  
 
 162  
 }