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